Thursday, September 29, 2011

Can Unit Testing Improve Testability?

While writing unit tests software engineers tend to relook at the source code and improve it so that it becomes testable. This is an internal experience. When you do this your code becomes maintainable as well. Have you gone through this experience?

You get this experience when you write unit tests for the complex pieces of your source code.

Two recent articles on topics related to this subject are ‘Breaking Away From The Unit Test Group Think’ by Cedric Beust and ‘Chasing Code-Coverage Baubles’ by Andrew Binstock. A good read for all software engineers.

These articles reveal several misconceptions related to Unit Testing and TDD and provide answers to the following questions.
  1. Do you think 90% code coverage through unit testing is sufficient?
  2. Do you think you need to do TDD always in your development cycle? 
  3. What is the optimal code coverage? How do you decide? 
  4. Has TDD become a common practice in the industry?

Thursday, September 22, 2011

Governance of Distributed Agile Projects: Critical Success Factors

On 15th October 2011, I am speaking at 'Agile Tour 2011, Pune'. India Scrum Enthusiasts Community is organizing this event. Agile Tour is a forum for Agile practitioners at all levels - from young engineers to professionals at very senior levels.

The title of my session is 'Governance of Distributed Agile Projects: Critical Success Factors'.  

This session is based on an article published in the July 2011 issue of Agile Record.

Sunday, September 18, 2011

Requirement Engineering: Asking Context-Free Questions

Exploring Requirements: Quality Before Design’ by Donald C. Gause and Gerald M. Weinberg is a must read for students as well as professionals. In this book, the authors emphasize that project teams need to ask context-free questions in order to understand high level details that are necessary to create the right product in the right way. According to them there are two primary categories of context-free questions: a) context-free process questions and b) context-free product questions. Also, they discuss about the third broad category of questions called metaquestions or questions about questions. Context-free questions are applicable to any product design. They consume less effort but provide an opportunity to obtain valuable information.

Context-free questions can be used in Software Engineering irrespective of the lifecycle methodology used. Also, IT consulting teams can use context-free questions during portfolio analysis or assessment phase in order to better understand the customer requirements.

Context-free process questions relate to the process to be followed and the answers to context-free questions relate to the project or the lifecycle activities. Context-free product questions relate to the design of the product and the answers to context-free product questions provide details on attributes, considerations or trade-offs related to design of the product. Let me share few examples here. Most of these examples are based on my experience.

Examples of Context-Free Process Questions:
  1. What are the success criteria for this project? Or how do we measure the success of this project?
  2. What are the driving factors for executing this project with a collocated team (or distributed team) or a consulting partner?
  3. How much time do we have for this project?
  4. What is your trade-off between schedule and quality?
  5. Where else can the solution to this design problem be obtained?
  6. Can we reuse something that already exists? Can we use open source?
  7. Who are the competitors for this product?
Examples of Context-Free Product Questions: 

  1. What problems does this product solve?
  2. What problems could this product create?
  3. What are the operational environments for this product?
  4. What kind of precision is required or desired in the product?
  5. What are the interfacing standards to be followed?
Examples of Metaquestions:
  1. Am I asking you too many questions?
  2. Do my questions seem relevant?
  3. Who is the right person to answer these questions?
  4. Do you think our team needs to contact multiple members in your organization to get answers to these questions? 
Context-free questions help us identify hidden assumptions. They help us identify the right approach to design applications or products. Also they help us design the right applications or products. 

Monday, September 12, 2011

Computer Programming: Art or Science?

Donald E. Knuth, one of the world’s eminent computer scientists, published hundreds of papers and evangelized computer science through his writings and teachings. His three volumes of ‘The Art of Computer Programming’ are among the most popular books in computer science.

In an interview he said, “When you write a program, think of it primarily as a work of literature. You’re trying to write something that human beings are going to read. Don’t think of it primarily as something a computer is going to follow. The more effective you are at making your program readable, the more effective it’s going to be: You’ll understand it today, you’ll understand it next week, and your successors who are going to maintain and modify it will understand it.”   

Programming is not a mechanical activity. Successful compilation of programs is not the end to programming. Putting your programs through a static analysis tool (for eg., JTest) is just the beginning. Programmers need to understand the errors reported by such tools and develop the ability to pick and choose the right set of fixes that can improve code quality. Also, programmers need to practice refactoring in order to improve code quality.

An interesting analogy is cookery. Those who carry the passion for cooking do not blindly follow a set of instructions or restrict themselves to using state-of-the-art tools. They think of it as a work of art. 

By the way, the full version of Donald E.Knuth's interview is available at the website of Dr.Dobb's journal.

Tuesday, September 6, 2011

Data Mining for Environmental Protection

Data Mining is an emerging field of computer science. It involves data processing, data analysis and derivation of useful information from large databases or data marts.

Life-Cycle Assessment (LCA) is a technique used to estimate the environmental footprints of hardware products by taking a comprehensive view of multiple environmental impacts such as greenhouse emissions of products. Interestingly Data Mining can be used to automate Life-Cycle Assessment (LCA). This is a wonderful application of Software Engineering for environmental protection.

A recent article titled 'Using Data Mining to Help Design Sustainable Products' published by IEEE is a very good read on this subject.

You may ask, ‘How Green is my iPad?’. The answer to this question was elaborated by Daniel Goleman and Gregory Norris in their article published by New York Times, 4th April 2010.

Another interesting article on this subject has been published by Brazilian Journal of Oceanography. The title of this article is  'Data mining for environmental analysis and diagnostic: A case study of upwelling ecosystem of Arraial do Cabo'.

Is there a way to monitor illegal dumping of garbage and toxic material? The answer is yes. Read ‘Monitoring of Illegal Dumping Using Spatial Data Mining and Remote Sensing’ for more information.

Here is an example on how governments are funding research in this area:
Environmental data mining: learning algorithms and statistical tools for monitoring and forecasting

Isn't it interesting?