× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 10/22/2013 8:34 PM, Dan Kimmel wrote:
One of the tenets of agile, as I understand it, is to write the tester before you write the code. To make that really successful the tester must rely on a certain amount of reflection in the language. OO languages are reflexive by definition. RPG is in no way reflexive.


You don't need reflection to be able to write tests first.

You have to write unit tests anyway. Using Test Driven Development (TDD, one of the techniques under the Agile umbrella), if you can write tests after, you can write them before. The basic principles of Test Driven Development are is that you write a line of code without having a failing testcase that demands that line of code.

- write a testcase to test one specific thing (or add another variation to an existing testcase)
- write the smallest amount of code necessary to make the test pass. If you have an urge to also code for something else in case you forget, add it to your list of future tests, don't add more code
- run the test
- run other self-checking tests for that code
- repeat

Sometimes writing self-checking testcases is difficult, but it's worth taking the time to automate as many tests as possible. And even if it's not possible to run all tests after every change, it might be possible to run all the tests every day. Even if it's not perfect "TDD", writing unit tests before rather than after tends to give much better test coverage.

Remember that TDD is a developer task, not a tester task. The testcases for TDD should never be written by someone else (except in a pair-programming situation, but that's still not a "tester" writing the testcases, it's just the other half of the development team).

I use TDD to develop the RPG compiler and runtime. The RPG compiler is probably as far as you could get from the kind of code (Java, OO) that you usually see in TDD discussions. The testcases are actually RPG source code, where different RPG statements target different functions in the RPG compiler.

"Agile" means many things, not just TDD.


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.