clean code - future-network.at€¦ · swql präsentationsvorlage 16:9 v1.0 © software quality lab...
TRANSCRIPT
SWQL Präsentationsvorlage V11.0
© Software Quality Lab www.software-quality-lab.com
Software Quality Lab
Reinhard EisnerBerater & Trainer
Clean Code
SWQL Präsentationsvorlage 16:9 V1.0
© Software Quality Lab www.software-quality-lab.com - 2 -
Innovation Meets Quality
Für Clean Code haben wir keine Zeit!
SWQL Präsentationsvorlage 16:9 V1.0
© Software Quality Lab www.software-quality-lab.com - 3 -
Innovation Meets Quality
Zeitaufwand für Code-Änderungen
Einlesen70%
Programmieren10%
Problem lösen20%
Aufwand des Entwicklers bei Änderung von bestehendem Code
C. Lilienthal, Langlebige Software
Architekturen: Technische Schulden
analysieren, begrenzen und
abbauen, dpunkt.verlag, 2017.
SWQL Präsentationsvorlage V11.0
- 4 -
1659 LOC / 1301 SLOC
SWQL Präsentationsvorlage V11.0
- 5 -
12
3
4
5
6
789
10
SWQL Präsentationsvorlage V11.0
29
28
27
SWQL Präsentationsvorlage 16:9 V1.0
© Software Quality Lab www.software-quality-lab.com - 7 -
Innovation Meets Quality
Beispiel
- 7 -
http://thedailywtf.com/articles/string-isvalidarticle-string-article
static StringBuilder vsb = new StringBuilder();
internal static string IsValidUrl(string value)
{
if (value == null)
{
return "\"\"";
}
vsb.Length= 0;
vsb.Append("@\"");
for (int i=0; i<value.Length; i++)
{
if (value[i] == '\"')
vsb.Append("\"\"");
else
vsb.Append(value[i]);
}
vsb.Append("\"");
return vsb.ToString();
}
SWQL Präsentationsvorlage 16:9 V1.0
© Software Quality Lab www.software-quality-lab.com - 8 -
Innovation Meets Quality
Clean Code vs. Bad Code
- 8 -
SWQL Präsentationsvorlage 16:9 V1.0
© Software Quality Lab www.software-quality-lab.com - 9 -
Innovation Meets Quality
Source code changes
Ideally
Improved software design
Conforms to coding guidelines
Documented updated
Tested
„Hotfix“
asap
As little resources as possible
- 9 -
SWQL Präsentationsvorlage 16:9 V1.0
© Software Quality Lab www.software-quality-lab.com - 10 -
Innovation Meets Quality
Technical debt(Technische Schulden)
- 10 -
https://www.flickr.com/photos/egarc2
SWQL Präsentationsvorlage 16:9 V1.0
© Software Quality Lab www.software-quality-lab.com - 11 -
Innovation Meets Quality
Technische Schulden kosten Technische Schulden
100%
Enw
icklu
ngsle
istu
ng
100%
En
wic
klu
ngsle
istu
ngP
roje
kts
tart
Neue F
eatu
res
Zeit
Je mehr technische Schulden
angehäuft werden, desto weniger
Entwicklungsleistung kann in neue
Features umgesetzt werden.
Wart
ung
SWQL Präsentationsvorlage 16:9 V1.0
© Software Quality Lab www.software-quality-lab.com - 12 -
Innovation Meets Quality
Boy scout rule
- 12 -
Always leave the
campground cleaner
than you found it.
Small steps, e.g.
• Meaningful variable names
• Split long function into two shorter functions
• Remove duplicated code by a function
https://upload.wikimedia.org/wikipedia/commons/8/84/1996-Rover_Moot-Fahnengru%C3%9F.jpg
SWQL Präsentationsvorlage 16:9 V1.0
© Software Quality Lab www.software-quality-lab.com - 13 -
Innovation Meets Quality
Code Smells & Test Smells
SWQL Präsentationsvorlage 16:9 V1.0
© Software Quality Lab www.software-quality-lab.com - 14 -
Innovation Meets Quality
Code Smell
Code smell is any symptom in the source code of a program that possibly indicates a deeper problem. Code smells are usually not bugs -- they are not technically incorrect and don't currently prevent the program from functioning.
Code smells indicate weaknesses in design that may be slowing down development or increasing the risk of bugs or failures in the future.
- 14 -
https://martinfowler.com/bliki/CodeSmell.html
SWQL Präsentationsvorlage 16:9 V1.0
© Software Quality Lab www.software-quality-lab.com - 15 -
Innovation Meets Quality
SonarQube und weitere Tools
Statische Analyse Tools
SWQL Präsentationsvorlage 16:9 V1.0
© Software Quality Lab www.software-quality-lab.com - 16 -
Innovation Meets Quality
SonarQube
- 16 -
https://sonarcloud.io
SWQL Präsentationsvorlage 16:9 V1.0
© Software Quality Lab www.software-quality-lab.com - 17 -
Innovation Meets Quality
Weitere Tools
ReSharper
Teamscale
CppCheck
Checkstyles
PMD
JSLint
SWQL Präsentationsvorlage 16:9 V1.0
© Software Quality Lab www.software-quality-lab.com - 18 -
Innovation Meets Quality
Öffentlichee Seminare
24.09.2019, Stuttgart
02.10.2019, Wien
23.10.2019, München
SWQL Präsentationsvorlage V11.0
© Software Quality Lab www.software-quality-lab.com
Innovation Meets Quality
Thematische
Schwerpunkte
Sonstige
Informationen
Kontakt
CV
Diplom Ingenieur Informatik
Mehr als 25 Jahre Erfahrung in über 140 Projekten im Bereich der Software-Entwicklung, Projektmanagement und Beratung
Seit 2003 Eigentümer und Geschäftsführer der Software Quality Lab GmbH
Software Entwicklungsprozess, Vorgehensmodelle, Prozessmodelle
Requirements-Engineering und Usability
Testmanagement Projektmanagement & Controlling, Risikomanagement
Standards, Normen und Zertifizierungen
IT-Strategie und Unternehmensentwicklung
Ausschreibungen und vertragliche Fragen in Software-Projekten
Gerichtlich beeideter Sachverständiger für Informatik
Staatlich geprüfter und beeideter Ziviltechniker für Informatik
Vizepräsident der Österreichischen Vereinigung für Software Qualitätsmanagement
Vizepräsident des Austrian Testing Boards (ATB)
[E] [email protected] [T] +43 5 0657-449
Reinhard EisnerBerater, Trainer
HTBLA Betriebsinformatik, Neufelden
Masterstudium Wirtschaftsinformatik, JKU Linz
Seit mehr als 8 Jahren in der Softwareentwicklung tätig
Berater für Softwarequalität und Werkzeuge
Software Entwicklungsprozess, Vorgehensmodelle, Prozessmodelle
Agile Softwareentwicklung
Tool Expertise
Unit Testen
Clean Code
Software Projektmanagement
ISTQB® Certified Tester
iSAQB® Certified Professional for Software Architecture
SWQL Präsentationsvorlage V11.0
© Software Quality Lab www.software-quality-lab.com
Academy | Consulting | Operational Services | Tool Expertise
INNOVATION MEETS QUALITY
Software Quality Lab