Software Architecture and Design - Sample Questions and Answers

 


1.1. What are software development models?
Over the years, various models have emerged to support the development of high-quality software products. A few of the most widely adopted models are:

• Waterfall development model
• Spiral development model
• Incremental iterative model
• Extreme programming
• Scrum
• Agile methodology

1.2. What is waterfall development model?
It is a sequential approach to software development that begins at the system level and progresses through analysis, design, coding, testing, and maintenance. It produces highly reliable systems.

The waterfall development model encourages the development team to specify the business functionality of the software prior to developing a system. It then breaks the complex mission of development into several logical steps, starting with requirements gathering and ending with release. The waterfall development model is checked for proper execution and quality through validation of entry requirements and exit criteria.

1.3. What is spiral development model?
The spiral development model combines the waterfall development model and the prototype approach, which is a series of partial implementations of the product.

Advantages of the spiral development model include an early focus on reusing existing software components, the incorporation of software quality standards and the integration of hardware and software development cycles.

1.4. What is incremental iterative model?
“Incremental” means “add onto”.
“Iterative” means “alter”.

In an incremental development, a final tested code is produced that is a part of what is finally needed. Then you repeat and produce another piece of final, tested code. You “add onto” the existing chunk, grow it.

In an iterative development, you produce a best first guess at a piece of design or code, and you evaluate it. Then you go and improve it, for example, UI (user interface) design.

Most people do both at the same time, so they do not notice the difference. But if you get them mixed up you can mess up badly.

1.5. What is object-oriented?
The term “object-oriented” means that we organize software as a collection of discrete objects that incorporate both data structure and behavior. This is in contrast to conventional programming in which data structure and behavior are only loosely connected.

1.6. What are the advantages of object-oriented programming over non-object-oriented programming?
Most obvious advantage of object-oriented programming (OOP) is that it provides an excellent way to model the real world by associating data to the methods operating on them. This is accomplished by preventing direct access to member variables from outside the class and retaining the values of the member variables throughout the life of the object. Parts of the program outside the class may work with the member variables only through methods that allow the caller to retrieve and modify the data. This makes it easy to segregate various parts of a program, and it can make large projects more manageable by hiding disparate parts of a project from one another.

These benefits, however, can be achieved in non-object-oriented programming using modules or a similar construct. For example, in C, it is common to use constructs known as abstract data types (ADTs). These are modules associating data to the functions operating on them and allowing a caller to retrieve and modify the data. This association is accomplished by defining an ADT that is a pointer to a struct of values. These values are equivalent to the member variables in OOP. All functions that access the data require this ADT as an argument. In this manner, it is possible to bind data and functions. While this is less elegant than using the class construct in C++ or Java, it can be used to obtain the same advantages.

The truly unique benefit of OOP is inheritance. It is generally not possible to use inheritance in non-object-oriented languages.

Inheritance is extremely important because it makes large libraries more manageable and encourages code reuse. While large, useful libraries have been around since the dawn of programming, inheritance makes them easier to use. Inheritance gives programmers an easy way to modify or tailor a library to their needs without having to modify the library code.

Finally, inheritance allows programmers doing similar or repetitive tasks to inherit common functionality from a base class. This code reuse leads to faster development. Inheritance makes OOP a better way to program.

1.7. What are the OOAD (object oriented analysis and design) advantages?
The two main advantages of object-oriented systems are reusability and interoperability.

Reusability, being able to reuse existing knowledge and program code, can produce advantages as a new system is developed or an existing system is maintained or re-engineered. Once an object class has been created, it can be reused, perhaps with only minor modifications, in other systems. This means that development costs invested in one project can produce dividends in other projects as well.

Interoperability is the ability to integrate applications from several sources, such as custom-developed programs and prewritten software, and to run these applications on a variety of hardware platforms.

Reusability and interoperability produce four solid advantages:

1 Increased development speed
2 Reduced development cost
3 High-quality code
4 Reduced system maintenance and re-engineering cost

1.8. How does object-oriented design help code reuse?
By breaking functionality into normalized units of components, code is neater, easier to locate, and better structured. Each of these characteristics helps promote code reuse.

1.9. What are the OOAD disadvantages?
The advantages of object orientation do not come without some potential disadvantages. OOAD can be difficult to apply, requiring a project team that fully understands the concepts and how they differ from the traditional data- and process-modeling approaches. Some of the disadvantages are:

1 Lengthy time required to acquire development experience
2 Difficulty of the methodology in describing complex business systems
3 Lack of a wide selection in development tools tailored specifically to business systems

1.10. What process should I follow for object-oriented analysis and design?
There are a number of different ways whereby you can perform OO analysis and design. The whole process follows a well known approach called incremental iterative development. So what does that mean? This approach differs from the traditional waterfall approach. In this approach the software is developed in increments. New functionality is added during every increment. There is a very fine line as to what an increment is and what iteration is. Basically you iterate a number of times in an increment. An increment is typically for a small period; say a few weeks, depending on the project. Each increment goes through: Use Case Analysis--> OO Analysis and Design--> Coding --> Testing--> Refactoring (Order need not be strictly followed).

• Use Case Analysis. This is a requirements gathering phase where use cases are written. A discovery phase to see what you have to do.
• OO Analysis and Design. Here you take a subset of use cases and start identifying the object model. UML notation is a very powerful way of coming up with this model. Use tools like whiteboard, Visio for UML drawing for class, sequence diagrams etc. You have three levels of object modeling as per Martin Fowler: Conceptual, Specification, and Implementation.

For more of this check out www.martinfowler.com. Then you go through coding and unit testing at code level. Testing should drive the coding process. First you write test cases and then write code to pass those test cases. A OOD framework for Java projects is JUnit. In the end do refactoring. Check out www.refactoring.com.