2P5 - Explain the role of software design principles and software structures in the IT systems development lifecycle.
3Overview.Software design principles and software structures are used to ensure that software is written as efficiently as possible, and to reduce the risk of having poorly designed software. SDPs and SS’s provide a guide and a structure around which the software can be written throughout the development lifecycle (illustrated on the right).
4Methodologies.There are many different methodologies that can provide a structure for the development lifecycle. Some examples;Waterfall.RAD.Spiral.Extreme.These can help to organise how the development lifecycle will be run.
5Software Design Principles. There are three main characteristics of a bad design that should be avoided.Rigidity.Making the software rigid will make it hard to change as these changes will affect other parts of the system too much.Fragility.When changes made to the software break other parts of the system then you will have to do impact analysis on the whole project which will take time and could cost money.Immobility.When it is hard to reuse in other applications as it cannot be easily extricated.There are more advanced design principles re the actual coding of software such as the;Open Close Principle.Dependency Inversions Principle.Single Responsibility Principle.Liskov’s Substitution Principle.Interface Segregation Principle.
6Basic Software Structures. Sequence.A collection of statements that are performed in order one after another.Selection.A decision or conditional statement that lets the program execute a set of code statements.Iteration (Looping).Iteration algorithms make use of loops, doing something multiple times based on conditional statements.
7Some More Specific Software Structures. Procedural Structures.Procedural programming basically uses a set of computational steps (procedures) in order to accomplish a specific task. This is a fast process and because of it’s simplistic approach, it is often the paradigm used when teaching programming to beginners due to it’s relatively simple logic.Object Oriented Structures.Object orientated programming focuses on using objects rather than procedures in order to accomplish a task. This can be beneficial because it is modular, which allows separate objects to respond to the same instruction differently. Also, it allows the programmer to alter specific objects without altering the whole program.Procedural Structures Include –Modules.Procedures: Functions.Pre-defined code.Object Orientated Structures Include –Classes.Objects.Data abstraction.
8M1 – Explain the importance of the quality of code.
9The Importance Of Having Good Quality Code. Good quality code is important for a variety of different reasons. Here are a few examples;Having good quality code will mean that less human interaction will be required which can reduce the risk of human error, and it will make a system easier to maintain.If the quality of the code is high then the code will be easier to read and follow making any alterations or maintenance a lot faster and easier to perform.High quality code will be a lot more professional which will result in the programmers/company reputation increasing.
10Key Characteristics Of High Quality Code. Reliability.Readability.Robustness.Usability.Portability.Maintainability.Low Complexity.Efficiency.Reliability – Making sure that the code will work every time that it is run without producing errors, and making sure that it’s operation is consistent.Readability – Making sure that the code is easy to read and understand.Robustness – Making sure that the code will be able to handle and data that it is presented with without error.Usability – Making sure that the code is easy to understand and edit, and making sure that it can be used by others.Portability – Making sure that the code can be run on as many different machines and operating systems as possible.Maintainability – Making sure that the code is easy to edit without difficulty. Good technical documentation will help with this.Low complexity – This can help with readability and maintenance as the code will be as simple as it can be making it easier to understand.Efficiency – Making sure that the code performs operations as quickly as possible.
11D1 – Discuss the factors that can improve the readability of code.
12Some Factors That Can Improve The Readability Of Code. Indentation.Syntax Highlighting.Naming conventions.New Lines.Comments.Consistency.Indentation – This can increase the readability of code as it makes the structure of the code more obvious, making it easier to follow.Syntax highlighting – This can increase the readability of code as the reader will be able to ignore large sections of comments or code when searching for a specific line, for example. This can also make finding errors easier as editors highlight string literals in a different colour, so spotting a missing delimiter will be easier because of the colour contrast in the text.Naming conventions – Using naming conventions can increase the readability of code if (for example) they are used to abbreviate long names.New Lines – This helps to structure and organise the code. These can be used to separate lines of code that are logically different, for example. This will help to define different areas of code which will make the code easier to follow. Also, having more ‘white space’ can make it easier when viewing and trying to read the code.Comments – This can help to explain what a line of code is for/what it is doing if that line of code isn’t self explanatory. If it is, then comments should be avoided as ‘over commenting’ can create clutter. Comments should preface the line of code it is describing.Consistency - It is easier to understand code if the reader knows what to expect and where to look. If the project uses conflicting variable naming and commenting styles, for example, the reader has learn new styles and context switching, which will decrease the readability of the code.