Trial-and-Error.jpg
Source: iliketoquote, 2013


Alternative name(s)


Rapid prototyping (Gardiner, 2005); Test driven development; Test first development; Unit testing; Spike (Cobb, 2011);

Envision-Speculate-Explore-Adapt-Close cycle (Highsmith, 2004); Plan-Do-Study-Act Cycle (Deming, 1986 cited in Gardiner, 2005);


Description


Early software development projects followed a trial-and-error life cycle. Work began without a formal project plan, and software development was a cycle of code-test-debug until the software was acceptable for delivery (Gardiner, 2005).

The drawback to this code and fix approach were: 1) inability to manage large complex projects; 2) communication of the project status was difficult; 3) the temporary model lacked standardisation and therefore offered little potential for continuous improvement.

Rapid prototyping is used in the traditional project approach to gain more information about the customer's requirements. An iterative cycle of building a trial model (prototype), getting feedback from customer, and redesigning the prototype takes place in the design phase of the project until the customer is satisfied with the design. The project then continues through the waterfall cycle.

Deming plan-do-study-act cycle is also a form of trial-and-error in continuous project process improvement. A change is planned, implemented, and then studied for negative and positive results, action is then taken to incorporate the good and improve the bad process.



Agile values


Trial and error is about getting feedback and changing the process or product accordingly. This is in accordance with the agile values of Responding to Change rather than Following a Plan, and providing a Working Software over Comprehensive Documentation (Agile Manifesto, 2013).

Trial-and-error may seem an unprofessional practice, but however when applied to problems that are fuzzy and also complex, a solution can be derived from trial and error. It takes the Scrum value of Courage to apply this approach; to be Committed to finding a solution, to Respect and be Open to receive feedback in order to feed this into finding a solution.



Agile principles


Simplicity: The art of maximising the amount of work not done. In regards to trial and error, there is no point creating software or continuing to write code if you have discovered it does not work. It also follows the XP principles of team Reflection at Regular Intervals in order to tune and adjust according to the feedbacks, and become more effective.

The XP practice of using Spike to iteratively design and test a product is based on the XP principles of Continuous Attention to Technical Excellence and Good Design to enhance agility.

The practice of complex adaptive systems (CAS) is inductive learning. By trial and error and use of past experience and decision rules you converge to a final solution. The emerged solution will be retained and applied in finding the next solution. CAS thrives on the XP principle of Welcoming Changing Requirements, and adapting to it accordingly.

The XP practice of performing unit test before the start of product development ensures that the XP principle Deliver Working Software Frequently, within a Short Timescale is adhered to.



Agile practices


Agile includes a variety of practices that enable constant feedback on e.g. technical decisions, and customer requirements (Highsmith & Cockburn, 2001).

It is Pair Programming in XP, DSDM (dynamic systems development method) uses Prototyping for feedback on features.
For quality assurance ASD (adaptive software development) uses team reviews and end-of-iterations reviews, and advocates the Envision-Speculate-Explore-Adapt-Close cycle.

In XP, trial and error can be seen as Test-First programming encompassing writing the test for your program, or piece of code before writing the code. Writing the test first allows you to find a fault with the code before writing the code. (Beck, 2003).
Incremental Design, an XP practice, which makes use of designing the system daily rather than upfront design, this allows for understanding design faults immediately rather than at the end of the product build. (Beck, 2003).

Scrum allows for Release Planning, which incorporates writing user stories, prioritising the stories and clarifying the meaning of the stories for the purpose of effort estimation.
During Iteration Planning, it may be necessary to re-write the user stories as well as re-prioritising the stories, allowing for the adjustment of the iteration release.
Scrum also allows for Sprint Retrospective, which is accomplished by Team Reflection of what worked well, what didn't work so well and what can be changed and done better next time.

Crystal allows for Reflective Improvement is very similar to Scrum's Sprint Retrospective, in that it allows for the team to list what went well, what could have gone better and to implement those changes for the next iteration (Cockburn, 2004).



Discussion


Gardiner (2005) suggests that early software development was driven by trial-and-error, where no formal project plans were used. since then Traditional methodologies such as PRINCE2 have sort to place controls into the project life-cycle to support planning. For PRINCE2 this is done by having a business case supporting the reasons for the project, and during the project life-cycle to build learning logs which are then reviewed and acted upon, much in the same way that an Agile methodology such as Scrum, or XP, or Crystal, however, PRINCE2, even though it acts on the learning logs, does not allow for changes to take place during the project if the changes have an effect on the overall cost and time to completion of the project, in those cases, the learning logs are managed at the end of the Project. (Online PRINCE2, 2013).

In the Agile Methodology, one of its guiding values is Working software over Comprehensive documentation, if considered along with the Agile principles of Simplicity, Regular interval team reflection, Continuous attention to technical excellence and good design, and Delivery of working software regularly, then Agile methodologies not only allow for learning to be viewed as an important element of the project life-cycle, but a critical element, to this extent Agile encourages through its practices in, for instance XP, that teams Test-first before programming, this has the advantage of never writing code until you know it is correct, therefore fulfilling the principle of delivering working software frequently.
Scrum's release planning allows for planning to take place, but more so, allows for Re-planning during the iteration process, which can either lead to the iteration being altered to incorporate the new plan or can allow for later iterations to encompass the re-planning.


Links from this KA to other KAs


Trial and error is experiential learning; learning by doing. It is an approach to Project Learning, and also for Problem Solving. Trial and error also related with baby steps agile principle.


References


Agile Manifesto. (2013). Principles behind the Agile Manifesto. Available at http://agilemanifesto.org/principles.html [Accessed: 25 March 2013].

Cobb, C. G. (2011). Making Sense of Agile Project Management : Balancing Control and Agility. John Wiley & Sons, Inc. [Online]

Beck, K. (2003). Test-driven development by example Addison-Wesley

Cockburn, A. (2004) Crystal Clear. A Human-Powered Methodology for Small Teams, including The Seven Properties of Effective Software Projects. (p38). Addison-Welsey.

Deming, D.E. (1986) Out of the Crisis. Cambridge: Cambridge University Press. Cited in Gardiner, P.D. (2005) Project Management: A Strategic Planning Approach. Basingstoke: Palgrave MacMillan.

Gardiner, P.D. (2005) Project Management: A Strategic Planning Approach. Basingstoke: Palgrave MacMillan.

Highsmith, J. (2004) Agile Project Management: Creating Innovative Products Addison-Wesley Safari Tech Books Online [Online] Available at: http://proquest.safaribooksonline.com/book/software-engineering-and-development/agile-development/0321219775/copyright/cover

Highsmith, J. & Cockburn, A. (2001) 'Agile Software Development: The Business of Innovation.' Computer. 34(9) pp. 120-127 Available at: http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=947100&isnumber=20507

iliketoquote (2013) Don't start because it's easy Available at: http://www.iliketoquote.com/dont-start-because-its-easy-start-because-its-worth-trying-dont-stop-because-its-hard-stop-because-youve-tried-your-best/

Online PRINCE2. (2013). What is PRINCE2. Available at: http://www.onlineprince2.com/p2nlcom/About-PRINCE2/PRINCE2-Principles-Method [Accessed: 26 March 2013].


External links


http://jimhighsmith.com/dont-plan-speculate/ Don't Plan Speculate by Jim Highsmith (Publisher of Adaptive Software Development - ASD)

http://www.kruchten.org/agilevancouver/presentation_slides/Hewson%20APM%20intro.pdf The Anatomy of an Agile Project

http://www.andrejkoelewijn.com/blog/2011/08/11/what-is-agile/ Waterfall is behaving as if you have a crystal ball, Agile is the trial and error way of reaching your goals.