Professional Documents
Culture Documents
management
Dr inż. Krzysztof Rychlicki-Kicior
Lecture plan
● Definition of software quality
● Laboratories 50%
● Labs will be discussed during labs – for now, it will be a group project
Presentation plan
● Software quality – a definition
● performance,
● integrity,
● usability,
● reliability,
● security.
Software quality
Software quality can be considered in both ways:
● In a business context – how to fit the business needs and the context where it is used
● Performance?
● Integrity?
● The reverse rule is true, somewhat – software can be terrible, but as long as a business need
is fulfilled, they will be happy (although this, fortunately, changes over time)
Why do we need software?
● At this moment we can ask ourselves a question – why do we need software?
● Thinking about people and their needs related to software, we can mention many different areas:
○ solving everyday problems
○ communication
○ making life pleasant
○ as a tool for work
○ as an entertainment center
Why do we need software?
● In a business context, such a way of thinking does not make any sense
○ By cutting costs
Why do we need software?
● Both types of profit can be achieved in many ways
● Use software for marketing campaign optimization, which lets you reach more clients
Why do we need software?
● Similar situation happens in case of cutting costs:
○ Team management software let you better utilize your available employees
Why do we need software?
● Not every client, of course, might realize that software can give them
some sort of benefits. Sometimes software is bought, because…:
○ "Our company is very modern and follows the biggest players in the business"
Why do we need software?
○ Is it easily extensible?
● Remember that even high quality code does not necessarily confirm
the software quality overall
● High quality software should mean it has high quality code, but the
reverse statement is not always true
Software quality v. code quality
● Code quality can be measured using various metrics, from simple
ones based on number of lines per a file or a module, to more
complex, based on analyzing associations between various parts of
the application
● Very good effects can be achieved using simpler methods, tools and
processes during the software development process
Software quality management
● Now we reach the definition of SQM:
● A management process that aims to develop and manage the quality of software in such
a way so as to best ensure that the product meets the quality standards expected by the
customer while also meeting any necessary regulatory and developer requirements
● This definition is decent (much better than in Polish Wikipedia), but a bit generic one
Software quality management
● In the end, the goal of SQM is to ensure that the software will fulfill the client’s
needs and requirements, both functional and nonfunctional.
○ Functional completeness
○ Functional correctness
○ Functional appropriateness
ISO/IEC 25010:2011
● Performance
○ Time behaviour
○ Resource utilization
○ Capacity
ISO/IEC 25010:2011
● Compatibility
○ Co-existence
○ Interoperability
ISO/IEC 25010:2011
● Usability
○ Appropriateness recognizability
○ Learnability
○ Operability
○ Accessibility
ISO/IEC 25010:2011
● Relability
○ Maturity
○ Availability
○ Fault tolerance
○ Recoverability
ISO/IEC 25010:2011
● Security
○ Confidentiality
○ Integrity
○ Non-repudiation
○ Accountability
○ Authenticity
ISO/IEC 25010:2011
● Maintainability
○ Modularity
○ Reusability
○ Analysability
○ Modifiability
○ Testability
ISO/IEC 25010:2011
● Portability
○ Adaptability
○ Installability
○ Replaceability
Software development methodologies
● Software development methodology defines stages of a complex
software development production process
○ Modularization – is the system monolithic or can the separate parts be useful for the client,
too?
● Its name stems from the fact that consecutive steps of the process
“fall” one after the other, just like in a real-world waterfall
1. Requirement definition – getting all the information from the stakeholders and future users
2. Detailed requirement analysis – analysis of all information and dependencies used for
excluding any potential conflicts. The goal of this stage is to determine whether client
requirements have been properly understood.
3. Writing down the requirements – persisting the requirements in a way that fits the
particular case in the best way, e.g. user stories, use cases, diagrams.
Waterfall
● In cases of two previous phases it is important to define who the stakeholder is
● Stakeholders are people or organizations who are related to the discussed project
○ Future users
○ People/organizations responsible for the software that will be integrated with the new system
Waterfall
3. Design – the goal of this phase is to prepare and describe all the elements
of the system based on the constraints received from the analysis phase
1. While both analytical phases have very precise results, in the design phase you need to
describe how will the effect be achieved
7. Ongoing support
Agile programming
● Agile is an umbrella term for incremental SDMs created against to the
Waterfall
● The term was invented in the Agile Manifesto developed during the
2001 conference in Utah, USA
Agile Manifesto
To quote the original manifest:
○ Designing – only in larger projects, you need to ensure certain level of organization in your code
XP practices
● Pair programming
● Planning Game
● Test-Driven Development
● Refactoring
● Collective ownership
● Simple design
● System metaphor
● Sustainable pace
Agile – Scrum
● An agile methodology focused on improving software development process
by integrating the team and improving the communication within
● The client does not always know what they want in the beginning, so you
need to focus on the fastest possible delivery of working software artifacts
– deliverables – and reacting to vastly changing conditions from the client’s
perspective and his environment
Scrum – three important rules
● Transparency – every team member should have access to all the
information related to his/her tasks
● PO defines budget, financing and describes more complex problems in the software
development process to the stakeholders
● To sum up, PO is an only connection between stakeholders and the development team
Scrum – Scrum Master
● Scrum Master is responsible for complying to and fulfilling the Scrum
requirements
● SM removes all the problems and barriers that come up in the team
● Size – 3 to 9 people
Scrum – Sprint
● Sprint is a single part of a project lifecycle, which should result in
delivering a working, tested and deployed product
○ Dividing features into separate tasks that are inserted in the spring backlog
Scrum – how the project goes
● A Daily Scrum is organized every working day when all the progress,
problems and challenges are discussed and addressed – albeit briefly
○ Flexibility
○ Constant progress – spring frequency forces the team to deliver the product in a
regular way which in turn gives a possibility to react quickly by the client
○ It works best if the team works at the same time and place – it certainly gets a bit
difficult when the team is located in different time zones
○ It is more difficult to conform to Scrum’s rules when there is a need to integrate with
external services
How to create high-quality code
● During first half of the semester we discussed the high-quality software
○ Extensible
● That’s why we apply code refactoring – the process of improving code quality
without changing its behaviour
How to create high-quality code
● Code refactoring is a process performed after writing some amount of code
● Improving code quality is doable only after writing enough code, e.g. by
applying design patterns – it is only when we have enough code that we see
some patterns can be applied. Writing code that uses some patterns from
scratch is not impossible, but certainly is more difficult
How to write high-quality code
● Writing high-quality code is not an art of just writing excellent code itself
1
Clean Code: A Handbook of Agile Software Craftsmanship. Robert C. Martin
How to create good identifiers
Create human-friendly and clear names!
● Use consistent naming scheme (e.g. delete for all operations related for
deleting data instead of using remove and delete sometimes)
● Create complex names (e.g. state – can be a state of the machine, but
can be a geographical state in US)
1
Brian W. Kernighan and P. J. Plaugher
How to create good comments
Don’t comment bad code – rewrite it!1
1
Brian W. Kernighan i P. J. Plaugher
How to create good comments
Don’t comment bad code – rewrite it!1
● BAD!: Commenting the code out – especially when the code is committed to
the code repository!
1
Brian W. Kernighan i P. J. Plaugher
Functions
Write short functions!
● Write functions that do one thing and do it well
● Don’t expect that writing functions in that way happens from scratch – the
aforementioned advice is usually applied during code refactoring
Code formatting
● Code formatting increases readability which makes it easier to modify the code in
the future
● A single source code file should have a few hundred lines of code tops\
● Class variables should be declared at the top of the class, in one single group
● A single line of code should have 100-120 characters tops – the most important
aspect is not to be forced to scroll the editor
Code formatting
● Code indentation!
● A single set of code conventions should be used within one project or even
one organization – not conforming to conventions might result in less
readable code and even certain type of technical problems!
Object-oriented programming
Hide implementation details!
● Don’t show internal details of data structures – you will save time
whenever you’ll decide to change it in the future
● Whether or not you should use them depends on whether you use objects or
data structures
Error handling
Handle errors, but do not obfuscate the code!
● Use exception catching instead of returning code errors or setting the error
flags
● FAST – tests should be fast, i.e. their execution should not take too much time
● TIMELY – tests should be written just before the related feature code
Unit tests
Follow the five rules of unit tests (FIRST)
● On the top of the FIRST rule, tests should be readable and up to date with
the implementation code
● A good check on whether the class is too large is to check its name and
responsibilities
● If the name suggests that the class has too much on its plate – change it (the
class, not the name!)
Classes
Classes should be small, just like the functions!
● At the same time, separate implementation of the bootstrap process from the
rest of the code using factories design patterns
Groups of classes
● Use dependency injection, especially with annotations/decorators and
inversion of control
● It’s not always easy to change the application so it handles more threads
Multithreading
● Use critical sections and locks in order to limit access to shared data
● Feature Envy – concerns methods that use external data or methods too
often. You should consider move such data or methods within the given class