CiderCS3398 / CS3398-Cider-S2017

CS3398 Team Github
0 stars 2 forks source link

Research Test Driven Development #60

Closed sylchristian closed 7 years ago

sylchristian commented 7 years ago

Since I will be following the Agile manifesto, an integral part of quality assurance is test driven development. Since this is a concept with which I am unfamiliar, a small amount of research is required before I will be able to implement it.

sylchristian commented 7 years ago

I have done some research into this particular method of software development and have learned the following:

Test Driven Development is a way of writing software that emphasis writing short and simple 'unit tests' that intentionally go one step beyond what the program is currently capable of doing. Once the error has been demonstrated, the existing program is then modified in order to pass the test. Once this has been accomplished, the testing parameters are expanded so as to ensure the program will fail. This cycle repeats until the software is finished. Tests are written so as to be very simple and small, and target specific methods in the code to be tested.

This style of programming is conducive to writing simple and straightforward code by working in very small increments. Some practitioners of TDD go so far as to not add a single line of code without first writing a unit test that requires it.

Android Studio supports unit tests, and the documentation on the website offers a lot of information on implementing and writing tests for the IDE. The top level Gradle file needs the JUnit and the Mockito framework added in order to generate mock Android dependencies. With this done, a relatively simple class can be written to specifically invoke certain methods while providing input values and pressing buttons where necessary.

I believe that while learning a whole new way of writing software may seem daunting, implementing test driven development will actually be beneficial to our developers. Since we are writing software in an environment and using languages with which we are unfamiliar, test driven development will help us break down tasks into small, manageable increments that we can add to our existing app code in order to pass unit tests we write.

The following are links to relevant information used while researching this topic: https://developer.android.com/training/testing/unit-testing/local-unit-tests.html https://developer.android.com/training/testing/start/index.html