Question

In: Electrical Engineering

List down three ways of determination of good code.

List down three ways of determination of good code.

Solutions

Expert Solution

The quality of the code is important, as it impacts the overall software quality. And quality impacts how safe, secure, and reliable your code base is.

High quality is critical for many development teams today. And it's especially important for those developing safety-critical systems.

Good code is high quality. And it’s clean code. It stands the test of time. Bad code is low quality. It won’t last long.

Essentially, code that is considered good:

  • Does what it should.
  • Follows a consistent style.
  • Is easy to understand.
  • Has been well-documented.
  • Can be tested.

Testing Isn’t Enough

Programmers aren’t perfect. Manual code reviews and testing will never find every error in the code.

A study on “Software Defect Origins and Removal Methods” found that individual programmers are less than 50% efficient at finding bugs in their own software. And most forms of testing are only 35% efficient. This makes it difficult to determine quality.

Coding Errors Lead to Risk

The quality of code in programming is important. When code is low quality, it might introduce safety or security risks. If software fails — due to a security violation or safety flaw — the results can be catastrophic or fatal.

Quality Is Everyone’s Responsibility

Quality is everyone’s job. The developer. The tester. The manager. High quality should be the goal throughout the development process.

Reliability

Reliability measures the probability that a system will run without failure over a specific period of operation. It relates to the number of defects and availability of the software.

Number of defects can be measured by running a static analysis tool. Software availability can be measured using the mean time between failures (MTBF). Low defect counts are especially important for developing a reliable code base.

Maintainability

Maintainability measures how easily software can be maintained. It relates to the size, consistency, structure, and complexity of the code base. And ensuring maintainable source code relies on a number of factors, such as testability and understandability.

You can’t use a single metric to ensure maintainability. Some metrics you may consider to improve maintainability are the number of stylistic warnings and Halstead complexity measures. Both automation and human reviewers are essential for developing maintainable codebases.

Testability

Testability measures how well the software supports testing efforts. It relies on how well you can control, observe, isolate, and automate testing, among other factors.

Testability can be measured based on how many test cases you need to find potential faults in the system. Size and complexity of the software can impact testability. So, applying methods at the code level — such as cyclomatic complexity — can help you improve the testability of the component.

Portability

Portability measures how usable the same software is in different environments. It relates to platform in dependency.

There isn’t a specific measure of portability. But there are several ways you can ensure portable code. It’s important to regularly test code on different platforms, rather than waiting until the end of development. It’s also a good idea to set your compiler warning levels as high as possible — and use at least two compilers. Enforcing a coding standard also helps with portability.

Reusability

Reusability measures whether existing assets — such as code — can be used again. Assets are more easily reused if they have characteristics such as modularity or loose coupling.

Reusability can be measured by the number of inter dependencies. Running a static analyzer can help you identify these inter dependencies


Related Solutions

List the three ways the will may be contested.....
List the three ways the will may be contested.....
List the three alternate ways of describing Universal design
List the three alternate ways of describing Universal design
List five ways to provide good customer service for hospitalized patients and their visitors.
List five ways to provide good customer service for hospitalized patients and their visitors.
In the Republic, there is a discussion of three ways something can be considered good-i.e., there are three ways why or how something might be valued.
In the Republic, there is a discussion of three ways something can be considered good-i.e., there are three ways why or how something might be valued. What are the three ways, and what is an example of each? Of the three, which does ocrates consider to be the "highest" type of good? 
using C++. edit this code down below so that it will implement stack with linked list...
using C++. edit this code down below so that it will implement stack with linked list contains a default constructor, a copy constructor, and a destructor. #include <iostream> #include <vector> #include <string> #include <stack> #include <limits> using namespace std; class Stack { public: bool isEmpty(); int top(); int pop(); void push(int); void printList(); private: vector<int> elements; }; bool Stack::isEmpty() { return elements.empty(); } int Stack::top() { if(isEmpty()) { throw runtime_error("error: stack is empty"); } return elements.back(); } int Stack::pop() {...
Name three ways to identity which part of the Internal Revenue Code is relevant in a...
Name three ways to identity which part of the Internal Revenue Code is relevant in a research project.
List and discuss the three payment-determination bases. Explain the difference between a specific services payment unit...
List and discuss the three payment-determination bases. Explain the difference between a specific services payment unit compared to a bundled services payment unit. What are the three major ways that health care providers can control their revenue function? What are the three factors that influence pricing? Why does market share matter to a health care provider? What contract provision will best protect a hospital being paid on a DRG basis for inpatient services from a catastrophic patient? Why should providers...
List and discuss the three payment-determination bases. Explain the difference between a specific services payment unit...
List and discuss the three payment-determination bases. Explain the difference between a specific services payment unit compared to a bundled services payment unit. What are the three major ways that health care providers can control their revenue function? What are the three factors that influence pricing? Why does market share matter to a health care provider? What contract provision will best protect a hospital being paid on a DRG basis for inpatient services from a catastrophic patient? Why should providers...
List all of the ways in which the current tax code treats capital gains more favorably...
List all of the ways in which the current tax code treats capital gains more favorably than wage income.
The code in this question shows three ways that one can read data from a file...
The code in this question shows three ways that one can read data from a file in a Python program. Answer the following questions: Using the code as an example, explain why Python is a fixed format programming language. Describe what would be output for each of the print statements in the code listing. Given the difference in output, explain the different roles of readLine(), readLines(), and read() functions. with open("rainfall.txt","r") as inFile:    aLine = inFile.readLine() with open("rainfall.txt", "r") as...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT