<bijan.parsia, christos.kotselidis@manchester.ac.uk>
(bug reports welcome!)
A definition:
Software construction is the creation, assembly, or modification of executable programs typically via modification of the source code.
Not the only formulation of such a hierarchy!
Pro tip: Always know the problem you're solving!
10 lines of code = 10 issues.
500 lines of code = "looks fine."
Code reviews.
— I Am Devloper (@iamdevloper) November 5, 2013
Although it might seem that the best way to develop a high-quality product would be to focus on the product itself, in software quality assurance you also need to focus on the software-development process.
— McConnell, 20.2
Poor quality processes raises the the risk of poor quality products
The General Principle of Software Quality is that improving quality reduces development costs. McConnell, 20.5
Counterintuitive principle!
But...pick two:
Code creation (or coding) is the addition of new functionality by the generation of new code and units of code
The "zone" is a much higher productivity state
Some is better than none; enough is better still; there is too much
—Grace Hopper's Bug Report
A defect in a software system is a quality level (for some quality) that is not acceptable.
Debugging is the modification of code to remove (or mitigate) correctness defects.
An indication of a defect is a tangible record of a behaviour contrary to the (explicit or implicit) functional specification in a designated situation.
From John Regehr, "Classic Bug Reports"
def get_console_output(script, file_path):
try:
output = subprocess.check_output(['python', script,
file_path], stderr=subprocess.STDOUT,
timeout=200).decode('ascii’)
except subprocess.CalledProcessError:
return "-1 "* 4
except OSError:
print("No such file or directory.")
file_content = file.read()
lines=file_content.count('\n')
vs
def getLines(filename):
file = open(filename, 'rb')
num_lines=0
for line in file:
num_lines += 1
return num_lines
Optimisation is a transformation of code into sufficiently functionally equivalent code that has "better" resource utilisation.
But when projects do fail for reasons that are primarily technical, the reason is often uncontrolled complexity... When a project reaches the point at which no one completely understands the impact that code changes in one area will have on other areas, progress grinds to a halt.
McConnell, 5.2: Figure 5-3. An example of a system with six subsystems
McConnell, 5.2: Figure 5-4. An example of what happens with no restrictions on inter-subsystem communications
McConnell, 5.2: Figure 5-5. With a few communication rules, you can simplify subsystem interactions significantly
"Horst Rittel and Melvin Webber defined a wicked problem as one that could be clearly defined only by solving it, or by solving part of it (1973)." McConnell, 5.1
print(0)
print(1)
print(2)
print(3)
for i in range(4)
print i
or
print(0)
print(2)
for i in range(4)
if i % 2 == 0
print(i)
wc
(modified)HLEVE is Yet Another Metric