CiderCS3398 / CS3398-Cider-S2017

CS3398 Team Github
0 stars 2 forks source link

Learn about Test-Driven Development and how it is accomplished #63

Closed forrest87 closed 7 years ago

forrest87 commented 7 years ago

Learn the concept of test-driven development by reading the relevant chapter on it in the class textbook. Find sources online of how it is done in practice. Make a toy test.

forrest87 commented 7 years ago
                                          NOTES ON TEST-DRIVEN DEVELOPMENT

======================================================================

What is Test-Driven Development?

Test-driven development is a paradigm of program design by which developers and customers first identify the desired functionality of functions and systems before actually implementing any one of those things. In the case of unit testing, a developer will first create a test for production code that does not yet exist. The test, upon its initial run, should simply either fail or fail to compile. When production code is written after initial testing, it should be just enough to get the test to pass.

Acceptance testing, on the other hand, is for the customers of the product. While unit testing verifies the functionality of internal functions within a system, acceptance testing verifies that customer expectations for a product are satisfied. Acceptance tests are much broader than unit tests. They are not written in a coded fashion, nor are they written by developers. Instead, they are written by “customers, business analysts, testers, or quality assurance specialists”. Often, they are implemented using Web pages executed on a browser using FitNesse.

======================================================================

Benefits of Unit Testing and Acceptance Testing:

1) Simple tests are run more frequently, which allows for easier identification of deviations from how the system is supposed to run (i.e. bugs causing the system to break are identified more frequently and are allowed to exist no longer than a few minutes). This benefit is also known as verification.

2) “Both unit tests and acceptance tests are a form of documentation.” These are not static documents that must be read; rather, they actually serve as up-to-date, compilable, and executable examples. Unit tests can be run by the programmers, while acceptance tests can be run by customers.

3) Testing forces decoupling, both in software (objects and packages) and on the architectural level.

forrest87 commented 7 years ago

I've written a unit test for the updateRecipe() functionality. It will fail to compile because I haven't written the updateRecipe function/activity yet; however, this test's failure to compile conforms to the initial steps of test-driven development. The test, called TestUpdateRecipe.java, has been uploaded in our Code space on the Develop branch in the Research_And_Practice directory.