Keywords

test-driven development, framework, modeling

Start Date

1-7-2006 12:00 AM

Abstract

In test-driven development, programs for tests are written before coding the main program, andusing software frameworks for support testing, implementation of the program becomes easy by the frequentand low cost feedback of these tests. In this work, application of test-drive development framework forenvironmental software was attempted. As a case study, a simulator for photosynthesis and plant growth wasdeveloped using JUnit framework as a base of testing tool for test-driven development. In developmentphase, test case class which checking all equations in the model is constructed first, using JUnit with someextensions. And afterward, simulator for the model is developed, with the aid of this test case class. The testcase class and the simulator were developed independently by different programmers and checkingmisunderstandings of equations, in addition to simple coding errors. This test code is also utilized duringapplication phase of the model simulator. All equations in the model are tested for every simulationcalculation, therefore, some rare combination of variables which results exceptional case of some equationwill be checked and then users to be alerted. 2 years of simulation with 1 hour time-step was performedusing series of measured data of photo-irradiation, temperature, humidity, and wind speed at an arid land inLeonra, Western Australia. The simulation, running with the test case class, was alerted to the unsatisfiedleaf energy balance equation in some conditions. Afterwards, it became clear that the empirical equation forgas exchange conductance was the cause of such errors. The case study showed that utilization of the testcase class successfully found an error, easy to fix but difficult to find.

COinS
 
Jul 1st, 12:00 AM

Application of Test-Driven Development Framework for Environmental Software: A Case Study in Long-Term Photosynthetic Process Simulation

In test-driven development, programs for tests are written before coding the main program, andusing software frameworks for support testing, implementation of the program becomes easy by the frequentand low cost feedback of these tests. In this work, application of test-drive development framework forenvironmental software was attempted. As a case study, a simulator for photosynthesis and plant growth wasdeveloped using JUnit framework as a base of testing tool for test-driven development. In developmentphase, test case class which checking all equations in the model is constructed first, using JUnit with someextensions. And afterward, simulator for the model is developed, with the aid of this test case class. The testcase class and the simulator were developed independently by different programmers and checkingmisunderstandings of equations, in addition to simple coding errors. This test code is also utilized duringapplication phase of the model simulator. All equations in the model are tested for every simulationcalculation, therefore, some rare combination of variables which results exceptional case of some equationwill be checked and then users to be alerted. 2 years of simulation with 1 hour time-step was performedusing series of measured data of photo-irradiation, temperature, humidity, and wind speed at an arid land inLeonra, Western Australia. The simulation, running with the test case class, was alerted to the unsatisfiedleaf energy balance equation in some conditions. Afterwards, it became clear that the empirical equation forgas exchange conductance was the cause of such errors. The case study showed that utilization of the testcase class successfully found an error, easy to fix but difficult to find.