• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

can writing testing code before coding applicable everywhere ?

 
Ranch Hand
Posts: 1874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
one of the main proposition of XP is wrting test code before coding ? can it be applicable to all the situations ? If it is bnot possible to write it fro each & every siotuations , then what are the parameters to identify the important stages of project , especially in iterative kind of projects , where the requirements are coming everyday & time to market is very important ?
 
Author
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think it has anything to do with stages of a project. I develop test first because that way I go faster. I want to go faster at all stages of a project.
The obvious time I don't use test first is when I'm developing a UI or HTML screen and I need to experiment and look at the results until I find what I like. I then lock down what I like in the test.
------------------
author of:
Refactoring : Improving the Design of Existing Code
UML Distilled, Second Edition: A Brief Guide to the Standard Object Modeling Language
Analysis Patterns : Reusable Object Models
Planning Extreme Programming
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am a firm believer that trying to write the test first will cause you to write better code. The thought process required to figure out how to test a function will force you to expose the essence of the feature.
I can not think of a situation where writing the test first is not the right thing. I, like Martin will do some html without writing the test first. But, I know I am doing the wrong thing. I know how to test the html, but sometimes I am just a bad person.
When we are dealing with anything beyond a simple web page, the advantages in writing the tests first: the speed gain, the increase in accuracy, the qualitative improvement in the code itself completely overwhelm the effort required to write the tests.
chet
------------------
author of:
Extreme Programming Installed(The XP Series)
 
permaculture is giving a gift to your future self. After reading this tiny ad:
professionally read, modify and write PDF files from Java
https://products.aspose.com/pdf/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!