Book Appointment Now

Introduction to Test Driven Development (TDD) Quiz Answers

Get All Weeks Introduction to Test Driven Development (TDD) Quiz Answers

Week 01: Introduction to Test-Driven Development (TDD) Quiz Answers

Quiz 01:  Introduction to Testing

Q1. At which level of the software testing process do developers test an individual component of the system?

[expand title=View Answer]Unit testing [/expand]

Q2. During traditional release, what is the best environment to do performance testing?

[expand title=View Answer] Staging [/expand]

Q3. Behavior-driven development (BDD) focuses on the behavior of the system as observed from which perspective?

[expand title=View Answer] The outside [/expand]

Q4. Test-driven development (TDD) has which of the following advantages?

[expand title=View Answer] TDD keeps developers focused on the code’s purpose. [/expand]

Q5. Why do developers use test cases?

[expand title=View Answer]To ensure the code’s functionality [/expand]

Quiz 02: Introduction to Testing

Q1. Which aspects of your code can you test?

[expand title=View Answer] All aspects that you do and do not know of [/expand]

Q2. After cloning a new repository for a project on which you will work, what should be your next step?

[expand title=View Answer] Test the code. [/expand]

Q3. Testing has which of the following benefits for development?

[expand title=View Answer] Reduces development time [/expand]

Q4. At which level of the software testing process do developers combine individual units and test them as a group?

[expand title=View Answer] Integration testing[/expand]

Q5. In the software testing process, what is the purpose of acceptance-level testing?

[expand title=View Answer] Assess system compliance with business requirements. [/expand]

Q6. During the traditional release cycle, in which environment do developers perform unit testing?

[expand title=View Answer]Development [/expand]

Q7. Behavior-driven development (BDD) has which of the following advantages?

[expand title=View Answer] BDD keeps developers focused on the code’s purpose.[/expand]

Q8. Test-driven development (TDD) focuses on how the system works as observed from which perspective?

[expand title=View Answer] The outside [/expand]

Q9. Why do developers need both test-driven development (TDD) and behavior-driven development (BDD)?

[expand title=View Answer] TDD and BDD complement each other in the development process. [/expand]

Q10. What purpose do test cases serve?

[expand title=View Answer] Identify bugs in the code [/expand]

Week 02: Introduction to Test-Driven Development (TDD) Quiz Answers

Quiz 01 : Methods for Test-Driven Development

Q1. Which of the following features is available in Nose but missing in Unittest?

[expand title=View Answer] Running coverage automatically[/expand]

Q2. What is an assertion?

[expand title=View Answer] A statement that evaluates to either True or False[/expand]

Q3. Which of the following PyUnit assertions is useful for testing whether an object passed into it is the correct type returned from a function call?

[expand title=View Answer] assertIsInstance() [/expand]

Q4. What is the purpose of using happy paths in testing?

[expand title=View Answer] Ensure that functions produce the expected output.[/expand]

Q5. Why do developers use test fixtures?

[expand title=View Answer] Establish a known initial state for testing. [/expand]

Q6. Developers use test fixtures for which of the following situations?

[expand title=View Answer]Loading a database with a known data set [/expand]

Q7. What are the three levels of specificity at which test fixtures can operate?

[expand title=View Answer] Unit, integration, and system[/expand]

Quiz 02:  Methods for Test-Driven Development

Q1. In the basic workflow for test-driven development (TDD), what happens in the second step?

[expand title=View Answer] Write the program code. [/expand]

.

Q2. To create a DevOps pipeline, which type of testing must developers use for all testing?

[expand title=View Answer] Automated testing [/expand]

Q3. Which of the following Python testing frameworks is built into Python?

[expand title=View Answer] Doctest[/expand]

Q4. Which of the following commands can developers use to invoke Python with the unit test module and to run all the tests in the test folder?

[expand title=View Answer] python -m unittest discover [/expand]

Q5. Which of the following features is available in Nose but missing in Unittest?

[expand title=View Answer] Adding color coding to test output[/expand]

Q6. In which of the following ways do testing frameworks help developers build assertions?

[expand title=View Answer]Testing frameworks provide tools that simplify testing conditions. [/expand]

Q7. What purpose do assertions serve in testing?

[expand title=View Answer] Determining if tests have passed or failed [/expand]

Q8. What is the purpose of using sad paths in testing?

[expand title=View Answer] Verify that functions respond to exceptions appropriately. [/expand]

Q9. Test fixtures provide which of the following benefits for testing?

[expand title=View Answer] Repeatable results[/expand]

Q10. PyUnit provides six test fixtures. Assume you include all six in a test module. Which of the following sequences shows the order in which the test runner will execute the first three test fixtures?

[expand title=View Answer] setUpModule, tearDownModule, setUpClass [/expand]

Week 03: Introduction to Test-Driven Development (TDD) Quiz Answers

Quiz 01: Advanced Methods for Test-Driven Development

Q1. What is test coverage?

[expand title=View Answer] The percentage of lines of code executed during testing [/expand]

Q2. Why is continued testing important even at 100% test coverage?

[expand title=View Answer] To find additional bugs [/expand]

Q3. When generating fakes in Python, what is one purpose for using the Meta class inside the factory?

[expand title=View Answer] Indicates the model class for which the factory will create fakes [/expand]

Q4. Which of the following is a method for mocking?

[expand title=View Answer] Functional call patch [/expand]

Q5. Which of the following is a patching technique available in Python’s mock library?

[expand title=View Answer] Patching a function’s return value [/expand]

Quiz 02: Advanced Methods for Test-Driven Development

Q1. Why is high test coverage valuable for development?

[expand title=View Answer] Increases the likelihood that the code works as expected [/expand]

Q2. Fake data is more practical to use than real data in which of the following testing situations?

[expand title=View Answer] When testing requires only a small set of test data[/expand]

Q3. When generating fakes in Python, what is one purpose for using the Meta class inside the factory?

[expand title=View Answer] Provides information describing the purpose and number of fakes [/expand]

Q4. How do developers test fakes generated by a factory?

[expand title=View Answer] Developers test fakes just like real objects. [/expand]

Q5. What is mocking?

[expand title=View Answer]A process for creating fake objects that mimic the behavior of real objects [/expand]

Q6. Developers should use mocking for which of the following purposes?

[expand title=View Answer] Isolate their tests from external systems [/expand]

Q7. When patching, developers change the behavior of which of the following testing items?

[expand title=View Answer]Function call[/expand]

Q8. For which of the following situations is it useful to patch return values with data?

[expand title=View Answer] Testing objects with method calls [/expand]

Q9. Mock objects are useful in testing for which of the following reasons?

[expand title=View Answer] Mock objects can behave like real objects. [/expand]

Q10. In Python, how do you make a Mock object mimic a specific real object?

[expand title=View Answer] Specify the name of the real object in the spec parameter. [/expand]

Week 04: Introduction to Test-Driven Development (TDD) Quiz Answers

Quiz 01: Final Exam

Q1. Which of the following statements is a key principle of testing?

[expand title=View Answer]You can only test for the factors that you know.[/expand]

Q2. Testing has which of the following benefits for development?

[expand title=View Answer] Improves code quality[/expand]

Q3. At which level of the software testing process do developers test the entire software process?

[expand title=View Answer] System testing [/expand]

Q4. What is the purpose of integration testing?

[expand title=View Answer] Expose flaws in the interaction between components [/expand]

Q5. Behavior-driven development (BDD) ensures which of the following for developers?

[expand title=View Answer] Identifying the code’s purpose [/expand]

Q6. In the basic workflow for test driven development (TDD), what happens in the third step?

[expand title=View Answer] Write the program code. [/expand]

Q7. In which Python testing framework can you use nearly an infinite number of setup and teardown levels?

[expand title=View Answer] Pytest [/expand]

Q8. Assume you are using Python and have installed PyUnit, Nose, and Pinocchio. Which of the following commands can you use to perform unit tests and receive color-coded output?

[expand title=View Answer] nosetests –with-spec –spec-color [/expand]

Q9. Which of the following PyUnit assertions is useful for determining if an object is in a result set?

[expand title=View Answer] assertIn()[/expand]

Q10. PyUnit provides six test fixtures. Assume you include all six in a test module. Which of the following sequences shows the order in which the test runner will execute the final three test fixtures?

[expand title=View Answer] tearDown, tearDownClass, tearDownModule [/expand]

Q11. How does a missing test coverage report help developers improve their testing?

[expand title=View Answer] Reveals lines of code that need test cases[/expand]

Q12. When generating fakes in Python, what is one advantage of using the Faker class to generate fake data?

[expand title=View Answer] Creates a diverse set of test data[/expand]

Q13. Developers should use mocking for which of the following purposes?

[expand title=View Answer] Isolate their tests from a remote component [/expand]

Q14. For which of the following purposes is it useful to patch return values with data?

[expand title=View Answer] Controlling data returned from a function call [/expand]

Q15. Developers use mock objects for which of the following purposes?

[expand title=View Answer] Mimicking a real object [/expand]

Get All Course Quiz Answers of Software Product Management Specialization

Introduction to Software Product Management Coursera Quiz Answers

Software Processes and Agile Practices Coursera Quiz Answers

Client Needs and Software Requirements Coursera Quiz Answers

Agile Planning for Software Products Coursera Quiz Answers

Reviews & Metrics for Software Improvements Coursera Quiz Answers

Share your love

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Leave a Reply

Your email address will not be published. Required fields are marked *