In this section, we concentrate on comparing different algorithms and source code solutions that aim to solve the same problem. Design specifications can be interpreted in a variety of ways by different developers. Algorithms and source code created to solve the same problem will differ according to the approach used by the particular developer. We need to examine the advantages and disadvantages of different solutions. Different interpretations of the design specifications Design specifications aim to formalise the requirements that must be fulfilled. However, different developers will interpret these specifications in different ways. For example, consider the design of a bridge:
Software development involves many creative aspects. This is particularly obvious in regard to the design of the user interface, however it is also true for algorithm and source code development. It is natural for different people to interpret the same specifications in different ways. For example, the design specifications for a module may require the input of a date by the user. The date could be collected as a complete string or it could be collected in pieces as year, month and day. In the first case, the entire string must be validated and in the second case, each component would be validated once entered. Both interpretations fulfil the design specifications in different ways. GROUP TASK Activity Examine a number of different word processors. Make a list of functions that appear to fulfil the same design specifications but have been interpreted differently. Indicate which interpretation you preferred and state why you preferred this interpretation. Advantages and disadvantages of different approaches to reaching the solution Even if the design specifications are interpreted in the same way, it is likely that different developers will create quite different solutions. Most problems can be solved in an almost infinite number of ways. In this section, we are concerned with evaluating what makes one approach better than another when each approach solves the problem. We are interested in assessing the elegance and efficiency of different solutions. Elegance is a somewhat subjective term. It refers to solutions that are superior, cleverer or more refined. Elegant solutions will also be more readable, both in terms of the code itself and its related documentation. Unfortunately, there are no hard and fast rules; each approach needs to be critically examined, however a number of guiding questions may assist in this process:
|
11 SDD > 8.2 Introduction to Software Development > 8.2.3 Testing and Evaluating Solutions > 2. Evaluating the solution >
