SOFTWARE ENGINEERING

INTRODUCTION TO SOFTWARE ENGINEERING

AGILE SOFTWARE DEVELOPMENT

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which of the following is used to test the class you have created alone
A
Component testing
B
System Testing
C
Acceptance Testing
D
Usability testing
Explanation: 

Detailed explanation-1: -Component testing is a form of closed-box testing, meaning that the test evaluates the behavior of the program without considering the details of the underlying code. Component testing is done on the section of code in its entirety, after the development has been completed.

Detailed explanation-2: -Best way to do that is to pass in the instance of class Random via dependency injection. Then you could pass in a test double of type Random for your tests. This test double might be a mock created with a mocking framework. On the other hand Javas Random class is a pseudo random generator.

Detailed explanation-3: -createComponent() method is used to create an instance of the AppComponent. The spec then uses expect and matcher functions to see if the component produces the expected behavior.

There is 1 question to complete.