This document provides tips for writing high-quality code, including writing unit tests, avoiding god classes and excessive complexity, following principles like single responsibility and inversion of control, and conducting thorough code reviews. It emphasizes writing clean, well-structured code through practices like interface-based programming and composition over inheritance in order to make the code easy to maintain and extend over time.
This document provides an overview of C# and its future development. It discusses C#'s popularity and strategy to remain innovative while preserving compatibility. Recently added features include minor releases and improvements to performance, efficiency, and safety. Future features discussed include ranges, nullable reference types, null coalescing assignment, recursive patterns, default interface implementation, async streams, and async disposables. The document provides information on testing pre-release C# features using Roslyn, SharpLab, LinqPad, and public VSIX extensions. It includes code examples and demos of the new features. Presenter contact details are provided at the end.
The document discusses exceptions in .NET programs. It defines what exceptions are, how they are represented by classes in the .NET Framework that derive from the SystemException class, and how exceptions can be handled using structured exception handling with try, catch, and finally blocks. It also covers raising exceptions intentionally and filtering exceptions in catch blocks.
This document discusses code coverage tools and JaCoCo in particular. It summarizes that JaCoCo is an open-source Java code coverage library that collects execution data for Java applications and libraries. JaCoCo can collect data both offline from Java byte code or online by instrumenting Java applications dynamically. The document compares JaCoCo to other code coverage tools and outlines JaCoCo's integrations, metrics, and features to help developers test code coverage.
This document discusses automated testing for Android apps. It explains that there are different levels of tests, including unit tests, integration tests, functional tests, and acceptance tests. Unit tests test small modular code and run quickly in the Java Virtual Machine (JVM). Instrumented unit tests allow mocking object behavior using Mockito. User interface (UI) tests use JUnit and Espresso to simulate user interactions and check views. Espresso allows testing across multiple activities. The document provides examples of how to write tests using JUnit, Espresso, and ActivityInstrumentationTestCase2 and references additional resources for learning about testing Android apps.
This document provides an overview of various concepts in software engineering, including implementation, testing, debugging, development rules, and sayings around software development. It discusses principles like debugging and maintenance taking more time than implementation, data structures being more important than codes/algorithms, avoiding premature optimization, and releasing software often for early feedback. It also covers topics such as unit testing, avoiding obese code, intellectual property, management approaches, software development methodologies, and different types of testing.
This document provides an overview of test-driven development (TDD). It defines TDD as a technique for building software where tests are written before code to guide development. The key aspects of TDD covered are:
- Writing tests first before code, which helps improve design and ensures tests are written.
- The TDD mantra of Red-Green-Refactor, where tests initially fail (Red), code is written to pass tests (Green), then code is refactored to improve design.
- An example case study of a large Java project developed using TDD that has over 20,000 lines of unit tests providing over 90% test coverage.
Documenting Code - Patterns and Anti-patterns - NLPW 2016Søren Lund
How do we document code? A good solution is to create self-explanatory code; this somewhat eliminates the need to document the code. We still need some very basic documentation. Code comments are one form of documentation, that is often misused. This talk is about self-explanatory code, the documentation we need and code comment patterns and anti-patterns.
This document provides an overview of C# and its future development. It discusses C#'s popularity and strategy to remain innovative while preserving compatibility. Recently added features include minor releases and improvements to performance, efficiency, and safety. Future features discussed include ranges, nullable reference types, null coalescing assignment, recursive patterns, default interface implementation, async streams, and async disposables. The document provides information on testing pre-release C# features using Roslyn, SharpLab, LinqPad, and public VSIX extensions. It includes code examples and demos of the new features. Presenter contact details are provided at the end.
The document discusses exceptions in .NET programs. It defines what exceptions are, how they are represented by classes in the .NET Framework that derive from the SystemException class, and how exceptions can be handled using structured exception handling with try, catch, and finally blocks. It also covers raising exceptions intentionally and filtering exceptions in catch blocks.
This document discusses code coverage tools and JaCoCo in particular. It summarizes that JaCoCo is an open-source Java code coverage library that collects execution data for Java applications and libraries. JaCoCo can collect data both offline from Java byte code or online by instrumenting Java applications dynamically. The document compares JaCoCo to other code coverage tools and outlines JaCoCo's integrations, metrics, and features to help developers test code coverage.
This document discusses automated testing for Android apps. It explains that there are different levels of tests, including unit tests, integration tests, functional tests, and acceptance tests. Unit tests test small modular code and run quickly in the Java Virtual Machine (JVM). Instrumented unit tests allow mocking object behavior using Mockito. User interface (UI) tests use JUnit and Espresso to simulate user interactions and check views. Espresso allows testing across multiple activities. The document provides examples of how to write tests using JUnit, Espresso, and ActivityInstrumentationTestCase2 and references additional resources for learning about testing Android apps.
This document provides an overview of various concepts in software engineering, including implementation, testing, debugging, development rules, and sayings around software development. It discusses principles like debugging and maintenance taking more time than implementation, data structures being more important than codes/algorithms, avoiding premature optimization, and releasing software often for early feedback. It also covers topics such as unit testing, avoiding obese code, intellectual property, management approaches, software development methodologies, and different types of testing.
This document provides an overview of test-driven development (TDD). It defines TDD as a technique for building software where tests are written before code to guide development. The key aspects of TDD covered are:
- Writing tests first before code, which helps improve design and ensures tests are written.
- The TDD mantra of Red-Green-Refactor, where tests initially fail (Red), code is written to pass tests (Green), then code is refactored to improve design.
- An example case study of a large Java project developed using TDD that has over 20,000 lines of unit tests providing over 90% test coverage.
Documenting Code - Patterns and Anti-patterns - NLPW 2016Søren Lund
How do we document code? A good solution is to create self-explanatory code; this somewhat eliminates the need to document the code. We still need some very basic documentation. Code comments are one form of documentation, that is often misused. This talk is about self-explanatory code, the documentation we need and code comment patterns and anti-patterns.
How do we document code? A good solution is to create self-explanatory code; this somewhat eliminates the need to document the code. We still need some very basic documentation. Code comments are one form of documentation, that is often misused. This talk is about self-explanatory code, the documentation we need and code comment patterns and anti-patterns.
Good quality code is an essential property of a software because it could lead to financial losses or waste of time needed for further maintenance, modification or adjustments if code quality is not good enough.
Understanding, measuring and improving code quality in JavaScriptMark Daggett
The document discusses various ways to measure code quality, including objective and subjective metrics. It describes metrics like cyclomatic complexity, Halstead metrics, and NPATH complexity which measure different aspects of code such as complexity, readability, maintainability, and testability. The document also discusses tools that can analyze code quality and produce reports on lines of code, arguments per function, and other metrics. Overall, the document provides an overview of different techniques for measuring code quality both quantitatively and qualitatively.
Cucumber spec - a tool takes your bdd to the next levelnextbuild
CucumberSpec is a tool that combines Behavior-Driven Testing (BDT) using Gherkin with Model-Based Testing (MBT). It generates a test model from Gherkin scenario files, allowing automated generation of test cases. This provides benefits of both BDT like common language and MBT like exhaustive testing. The document demonstrates CucumberSpec by modeling and testing requirements for an AR drone using Gherkin scenarios and SpecExplorer modeling.
This document discusses going beyond unit testing for web applications. It introduces several tools for testing different aspects of web applications, including Selenium IDE for browser-based testing, soapUI for web service testing, and JMeter for performance and load testing. These tools can be run from the command line as part of continuous integration with Jenkins. The document cites research that unit testing only detects an average of 25% of defects, while integration testing detects 45%, and code reviews have even higher effectiveness rates.
Static and dynamic program analysis are techniques to analyze software without or with execution. Static analysis examines source code while dynamic analyzes programs running. Tools can automatically find defects by capturing patterns and anomalies. Defects include bugs, dead code, inefficient code, duplicate code. Analysis occurs at the unit, technology, system, and business levels. Java quality tools help with metrics, testing, coverage, and detecting issues like empty structures and wasteful practices. This aids writing standards-compliant code.
This document discusses various code quality tools such as FindBugs, PMD, and Checkstyle. It provides information on what each tool is used for, how to install plugins for them in Eclipse, and how to configure them for use with Ant builds. FindBugs looks for potential bugs in Java bytecode. PMD scans source code for coding mistakes, dead code, complicated expressions, and duplicate code. Checkstyle checks that code complies with coding style rules. The document explains how to download and configure each tool so it can be run from Eclipse or as part of an Ant build.
This document provides an overview of test-driven development (TDD). TDD involves writing tests before writing code to ensure new functionality works as intended. Key principles of TDD include writing failing tests first, then code to pass the tests, and refactoring code while maintaining all tests. TDD results in higher quality, flexible, readable and maintainable code. It also helps improve both internal code quality and external functionality through a well-designed development process focused on automated testing.
The document contains interview questions from various companies like HCL, Emids, Manhattan, 3PLM, Zolipe Solutions, Synchronoss, and Cognizant for positions ranging from 2-3 years of experience in Selenium testing. The questions cover a wide range of topics including Selenium, manual testing, Java, SQL, algorithms, data structures and design patterns. Common questions asked relate to frameworks, test automation lifecycles, handling dynamic elements, test case design techniques, and debugging skills.
Software quality is critical to consistently and continually delivering new features to our users. This talk covers the importance of software quality and how to deliver it via unit testing, Test Driven Development and clean code in general.
This is the deck from a talk I gave at Desert Code Camp 2013.
The document discusses various .NET debugging techniques, including:
1. The importance of debugging and the tools available for debugging .NET applications, such as Visual Studio and Debugging Tools for Windows.
2. Basic debugging tasks like setting breakpoints, stepping through code, and examining variables and call stacks.
3. Advanced techniques like debugging managed code, threads, and memory issues.
This document provides an overview of test-driven development (TDD). It discusses what TDD is, how the TDD process works through iterations of writing tests first then code, and the benefits it provides like increased confidence in changes and documentation of requirements. The document covers TDD basics like the red-green-refactor cycle and challenges in unit testing like dependencies. It emphasizes focusing on writing tests before code and not designing code in your head first. The document also compares mocking frameworks and argues the benefits of commercial frameworks like Typemock Isolator.
Systematic error management - we ported rudder to ziofanf42
This talk was given at ScalaIO 2019.
It explains how you can manage errors in a systematic way in your applications, and show how we did it in Rudder with the functional library ZIO.
It presents 4 big principles which direct my devloper job:
- 1/ Our work as developers is to discover and assess failure modes.
- 2/ ERRORS are a SOCIAL construction to give AGENCY to the receiver of the error.
- 3/ An application has always at least 3 kinds of users: users; devs; and ops. Don’t forget any.
- 4/ It’s YOUR work to choose the SEMANTIC between nominal case and error and KEEP your PROMISES.
The talk gives 5 guidelines to help you implement these principles. It also introduces a very light glimpse on system thinking that you can explore in more details in the related article "Understand things as interacting systems": https://medium.com/@fanf42/understand-things-as-interacting-systems-b273bdba5dec
If you have any questions, please ask: there is several way to contact me at the end of the deck (slide 87)!
Throwing Laravel into your Legacy App™Joe Ferguson
Do you work on a legacy application and yearn for the green fields and bountiful structure of an application built on a modern framework? Do you feel like the only path to modernizing your old workhorse app is to spend months or years rewriting it from the ground up? What if you could integrate modern packages from a full stack framework at your own pace instead of having to start over from scratch? Join us as we explore using Laravel components in your Legacy App™. Modernize how your application handles configuration, routing, container, database, and much more!
Speculative analysis for comment quality assessmentPooja Rani
Previous studies have shown that high-quality code comments assist developers in program comprehension and maintenance tasks. However, the semi-structured nature of comments, unclear conventions for writing good comments, and the lack of quality assessment tools for all aspects of comments make their evaluation and maintenance a non-trivial problem.
To achieve high-quality comments, we need a deeper understanding of code comment characteristics and the practices developers follow. Our preliminary findings show that developers embed various kinds of information in class comments across programming languages. Still, they face problems in locating relevant guidelines to write consistent and informative comments, verifying the adherence of their comments to the guidelines, and evaluating the overall state of comment quality.
To help developers and researchers in building comment quality assessment tools, we provide: (i) an empirically validated taxonomy of comment convention-related questions from various community forums, (ii) an empirically validated taxonomy of comment information types from various programming languages, (iii) a language independent approach to automatically identify the information types, and (iv) a comment quality taxonomy prepared from a systematic literature review.
Test-Driven Development is about approaching software development from a test perspective and knowing how to use the tools (e.g. JUnit, Mockito) to effectively write tests.
Source code examples @...
https://github.com/codeprimate-software/test-driven-development
This document discusses exception handling in .NET. It defines what exceptions are, how they are handled using try, catch, and finally blocks, and common exception types in .NET like IndexOutOfRangeException and NullReferenceException. It explains that exceptions allow error handling code to be separated from the main program logic and that finally blocks ensure cleanup code is always executed.
The document discusses unit testing principles and purposes. It states that unit testing is used to prove that classes work properly in isolation, catch bugs early, enforce high-quality code, and make refactoring safer. Unit testing encourages modular and loosely coupled code. However, it does not replace integration or system testing and not all code can be unit tested. The document also provides examples of when code should be refactored before writing unit tests.
This document discusses several Java code quality tools, including CodeProAnalytix for code analysis and metrics, PMD for detecting bugs and suboptimal code, FindBugs for finding correctness bugs and bad practices, and Cobertura/EMMA for code coverage analysis. It also mentions Checkstyle for checking code against coding standards, Tattletale for dependency analysis, and consolidated tools like Sonar and Xradar. Finally, it describes UCDetector for finding unnecessary public code.
Some of the most common and easy-to-calculate/easy-to-measure code metrics. Understanding these can help you make your code better: avoiding code rot and writing maintainable code all starts here. Content is created for C# .net, however, the underlying principles apply to other languages/frameworks as well.
The document discusses aspect-oriented programming (AOP) and its benefits and challenges. AOP can help solve problems by identifying cross-cutting concerns that can be modularized into aspects. While AOP is useful for implementing policies and capturing knowledge, programming stateful aspects is difficult and handling aspect side-effects can be challenging. The document expresses hope that AOP will find its place and that tools can help address current issues.
How do we document code? A good solution is to create self-explanatory code; this somewhat eliminates the need to document the code. We still need some very basic documentation. Code comments are one form of documentation, that is often misused. This talk is about self-explanatory code, the documentation we need and code comment patterns and anti-patterns.
Good quality code is an essential property of a software because it could lead to financial losses or waste of time needed for further maintenance, modification or adjustments if code quality is not good enough.
Understanding, measuring and improving code quality in JavaScriptMark Daggett
The document discusses various ways to measure code quality, including objective and subjective metrics. It describes metrics like cyclomatic complexity, Halstead metrics, and NPATH complexity which measure different aspects of code such as complexity, readability, maintainability, and testability. The document also discusses tools that can analyze code quality and produce reports on lines of code, arguments per function, and other metrics. Overall, the document provides an overview of different techniques for measuring code quality both quantitatively and qualitatively.
Cucumber spec - a tool takes your bdd to the next levelnextbuild
CucumberSpec is a tool that combines Behavior-Driven Testing (BDT) using Gherkin with Model-Based Testing (MBT). It generates a test model from Gherkin scenario files, allowing automated generation of test cases. This provides benefits of both BDT like common language and MBT like exhaustive testing. The document demonstrates CucumberSpec by modeling and testing requirements for an AR drone using Gherkin scenarios and SpecExplorer modeling.
This document discusses going beyond unit testing for web applications. It introduces several tools for testing different aspects of web applications, including Selenium IDE for browser-based testing, soapUI for web service testing, and JMeter for performance and load testing. These tools can be run from the command line as part of continuous integration with Jenkins. The document cites research that unit testing only detects an average of 25% of defects, while integration testing detects 45%, and code reviews have even higher effectiveness rates.
Static and dynamic program analysis are techniques to analyze software without or with execution. Static analysis examines source code while dynamic analyzes programs running. Tools can automatically find defects by capturing patterns and anomalies. Defects include bugs, dead code, inefficient code, duplicate code. Analysis occurs at the unit, technology, system, and business levels. Java quality tools help with metrics, testing, coverage, and detecting issues like empty structures and wasteful practices. This aids writing standards-compliant code.
This document discusses various code quality tools such as FindBugs, PMD, and Checkstyle. It provides information on what each tool is used for, how to install plugins for them in Eclipse, and how to configure them for use with Ant builds. FindBugs looks for potential bugs in Java bytecode. PMD scans source code for coding mistakes, dead code, complicated expressions, and duplicate code. Checkstyle checks that code complies with coding style rules. The document explains how to download and configure each tool so it can be run from Eclipse or as part of an Ant build.
This document provides an overview of test-driven development (TDD). TDD involves writing tests before writing code to ensure new functionality works as intended. Key principles of TDD include writing failing tests first, then code to pass the tests, and refactoring code while maintaining all tests. TDD results in higher quality, flexible, readable and maintainable code. It also helps improve both internal code quality and external functionality through a well-designed development process focused on automated testing.
The document contains interview questions from various companies like HCL, Emids, Manhattan, 3PLM, Zolipe Solutions, Synchronoss, and Cognizant for positions ranging from 2-3 years of experience in Selenium testing. The questions cover a wide range of topics including Selenium, manual testing, Java, SQL, algorithms, data structures and design patterns. Common questions asked relate to frameworks, test automation lifecycles, handling dynamic elements, test case design techniques, and debugging skills.
Software quality is critical to consistently and continually delivering new features to our users. This talk covers the importance of software quality and how to deliver it via unit testing, Test Driven Development and clean code in general.
This is the deck from a talk I gave at Desert Code Camp 2013.
The document discusses various .NET debugging techniques, including:
1. The importance of debugging and the tools available for debugging .NET applications, such as Visual Studio and Debugging Tools for Windows.
2. Basic debugging tasks like setting breakpoints, stepping through code, and examining variables and call stacks.
3. Advanced techniques like debugging managed code, threads, and memory issues.
This document provides an overview of test-driven development (TDD). It discusses what TDD is, how the TDD process works through iterations of writing tests first then code, and the benefits it provides like increased confidence in changes and documentation of requirements. The document covers TDD basics like the red-green-refactor cycle and challenges in unit testing like dependencies. It emphasizes focusing on writing tests before code and not designing code in your head first. The document also compares mocking frameworks and argues the benefits of commercial frameworks like Typemock Isolator.
Systematic error management - we ported rudder to ziofanf42
This talk was given at ScalaIO 2019.
It explains how you can manage errors in a systematic way in your applications, and show how we did it in Rudder with the functional library ZIO.
It presents 4 big principles which direct my devloper job:
- 1/ Our work as developers is to discover and assess failure modes.
- 2/ ERRORS are a SOCIAL construction to give AGENCY to the receiver of the error.
- 3/ An application has always at least 3 kinds of users: users; devs; and ops. Don’t forget any.
- 4/ It’s YOUR work to choose the SEMANTIC between nominal case and error and KEEP your PROMISES.
The talk gives 5 guidelines to help you implement these principles. It also introduces a very light glimpse on system thinking that you can explore in more details in the related article "Understand things as interacting systems": https://medium.com/@fanf42/understand-things-as-interacting-systems-b273bdba5dec
If you have any questions, please ask: there is several way to contact me at the end of the deck (slide 87)!
Throwing Laravel into your Legacy App™Joe Ferguson
Do you work on a legacy application and yearn for the green fields and bountiful structure of an application built on a modern framework? Do you feel like the only path to modernizing your old workhorse app is to spend months or years rewriting it from the ground up? What if you could integrate modern packages from a full stack framework at your own pace instead of having to start over from scratch? Join us as we explore using Laravel components in your Legacy App™. Modernize how your application handles configuration, routing, container, database, and much more!
Speculative analysis for comment quality assessmentPooja Rani
Previous studies have shown that high-quality code comments assist developers in program comprehension and maintenance tasks. However, the semi-structured nature of comments, unclear conventions for writing good comments, and the lack of quality assessment tools for all aspects of comments make their evaluation and maintenance a non-trivial problem.
To achieve high-quality comments, we need a deeper understanding of code comment characteristics and the practices developers follow. Our preliminary findings show that developers embed various kinds of information in class comments across programming languages. Still, they face problems in locating relevant guidelines to write consistent and informative comments, verifying the adherence of their comments to the guidelines, and evaluating the overall state of comment quality.
To help developers and researchers in building comment quality assessment tools, we provide: (i) an empirically validated taxonomy of comment convention-related questions from various community forums, (ii) an empirically validated taxonomy of comment information types from various programming languages, (iii) a language independent approach to automatically identify the information types, and (iv) a comment quality taxonomy prepared from a systematic literature review.
Test-Driven Development is about approaching software development from a test perspective and knowing how to use the tools (e.g. JUnit, Mockito) to effectively write tests.
Source code examples @...
https://github.com/codeprimate-software/test-driven-development
This document discusses exception handling in .NET. It defines what exceptions are, how they are handled using try, catch, and finally blocks, and common exception types in .NET like IndexOutOfRangeException and NullReferenceException. It explains that exceptions allow error handling code to be separated from the main program logic and that finally blocks ensure cleanup code is always executed.
The document discusses unit testing principles and purposes. It states that unit testing is used to prove that classes work properly in isolation, catch bugs early, enforce high-quality code, and make refactoring safer. Unit testing encourages modular and loosely coupled code. However, it does not replace integration or system testing and not all code can be unit tested. The document also provides examples of when code should be refactored before writing unit tests.
This document discusses several Java code quality tools, including CodeProAnalytix for code analysis and metrics, PMD for detecting bugs and suboptimal code, FindBugs for finding correctness bugs and bad practices, and Cobertura/EMMA for code coverage analysis. It also mentions Checkstyle for checking code against coding standards, Tattletale for dependency analysis, and consolidated tools like Sonar and Xradar. Finally, it describes UCDetector for finding unnecessary public code.
Some of the most common and easy-to-calculate/easy-to-measure code metrics. Understanding these can help you make your code better: avoiding code rot and writing maintainable code all starts here. Content is created for C# .net, however, the underlying principles apply to other languages/frameworks as well.
The document discusses aspect-oriented programming (AOP) and its benefits and challenges. AOP can help solve problems by identifying cross-cutting concerns that can be modularized into aspects. While AOP is useful for implementing policies and capturing knowledge, programming stateful aspects is difficult and handling aspect side-effects can be challenging. The document expresses hope that AOP will find its place and that tools can help address current issues.
Back-2-Basics: .NET Coding Standards For The Real WorldDavid McCarter
The document provides information about coding standards and best practices for .NET development. It recommends establishing coding standards for organizations to promote consistent and maintainable code. It also discusses specific standards for elements like namespaces, enums, classes, methods, and comments. Examples are provided to illustrate proper naming conventions, formatting, and defensive coding techniques.
Back-2-Basics: .NET Coding Standards For The Real WorldDavid McCarter
This session will guide any level of programmer to greater productivity by providing the information needed to write consistent, maintainable code. Learn about project setup, assembly layout, code style, defensive programming and much, much more. We will even go over some real in production code and see what the programmer did wrong in "What's Wrong With this Code?". Code tips are included to help you write better, error free applications. Lots of code examples in C# and VB.NET.
The document discusses principles for writing simple testable code including focusing on core values like simplicity over flexibility, keeping code clean and formatted, injecting dependencies through constructors or parameters to reduce coupling, writing isolated tests that assert behavior rather than implementation, and using refactoring to maintain simplicity. It also provides references for further reading on simple code design.
TDD is now mainstream but a lot people don't know or don't remember what is its purpose. TDD is about software design not testing or catching bug. TDD helps developers to shape and create software with "good" design, what is a "good" design is something that we will discuss in the topic.
Developers’ mDay u Banjoj Luci - Milan Popović, PHP Srbija – Testimony (about...mCloud
This document discusses the importance of testing software. It outlines 30 tips for writing tests, including writing tests before code, treating tests like code, minimizing asserts per test, using data providers, and allocating time for testing in estimates. Testing helps catch bugs, improve code quality, and ensure stability. The document emphasizes that automated testing is key and should test everything that could break an app.
The document provides a biography and background information on Daniel N. Egan, including his roles as a Microsoft Regional Director, Microsoft MVP for ASP.Net, author, and speaker. It then outlines the topics to be covered in the presentation, including object relational mappers, language enhancements in C# and VB.Net, LINQ goals, fundamentals and usage.
This document outlines best practices for implementing best practices across the software development life cycle (SDLC). It discusses hierarchical classification of performance tuning at the system, application, and machine levels. It also covers best practices for coding, including general guidelines, guidelines for specific technologies like JSP and EJB, and practices for code reviews like peer reviews and architect reviews. The goal is to apply best practices throughout the end-to-end processes of the SDLC.
This document provides information about a C# and .NET programming course at Linköping University. It outlines the course structure, staff, goals, literature, and assignments. The course runs over 8 weeks and includes 4 lectures, 18 supervised lab sessions, and 7 unsupervised lab sessions. It aims to teach students C# and .NET framework basics, Visual Studio skills, and improve teamwork. The final project involves developing a series of interrelated board game labs in pairs.
Journey's diary developing a framework using tddeduardomg23
The document provides guidance on test-driven development (TDD) using examples from building a query framework. It discusses using mocks to test classes that interact with external resources or have variable behavior. Tests take more effort initially to set up scenarios but become quicker with reused code. Refactoring is important when designs reach limitations. Integration tests can be used after defining class interfaces through unit tests. TDD helps define the design and catches errors early but some design knowledge is still needed.
How to do code review and use analysis tool in software developmentMitosis Technology
Code Inspection is a phase of the software development process to find and correct the errors in the functional and non-functional area in the early stage.
Stopping the Rot - Putting Legacy C++ Under TestSeb Rose
The document discusses introducing unit testing to legacy C++ code. It covers choosing a testing framework, writing initial tests and mocks, and various refactoring techniques like wrapping dependencies, extracting components, and adding non-intrusive C seams to facilitate testing. The goal is to incrementally make the code more testable while maintaining functionality through practices like test-driven development.
Create first android app with MVVM Architecturekhushbu thakker
This pdf is about how to create the first application in the android
-How to do clean code
-What is the MVVM Architecture design pattern and why required architecture in app.
Test-driven development (TDD) is a software development technique where unit tests are written before code to define desired functionality. Writing tests first helps produce code with better design, lower maintenance costs, and fewer bugs. Key principles of TDD include writing code only to pass failing tests and eliminating duplication. Benefits include better test coverage, easier refactoring, and preventing regressions. TDD helps developers act as users to define behavior through interactions between system components.
The document provides an overview of Daniel Egan's professional experience including his roles as a Microsoft Regional Director, Microsoft MVP for ASP.Net, Chief Architect at Odyssey Consulting Group, author, instructor, and his involvement with various .Net user groups. It then outlines topics to be covered including object relational mappers, language enhancements in VB.Net and C# 3.0, LINQ and LINQ to SQL.
This document provides an introduction and overview of C# programming. It discusses that C# is an object-oriented language developed by Microsoft as part of its .NET initiative. The document then covers the structure of a basic C# program, including namespaces, classes, methods, and the required Main method. It also compares C# to C++ and discusses key differences. Finally, it demonstrates how to add comments in C# code and how to use aliases for namespaces.
Why should we use TDD to develop in Elixir? When we are applying it correctly? What are the differences that we can find in a code developed with TDD and in code not developed with it? Is it TDD about testing? Really? In this talk, I'll show what is TDD and how can be used it in functional programming like Elixir to design the small and the big parts of your system, showing what are the difference and the similarities between an OOP and FP environment. Showing what is the values of applying a technique like TDD in Elixir and what we should obtain applying it.
Building Scalable Development EnvironmentsShahar Evron
The document provides guidelines for building scalable development environments in 3 main areas:
1. Establish standard programming styles and coding practices to reduce bugs and improve readability. This includes using source control, peer review, and coding standards.
2. Implement a multi-tier environment with separate development, staging, and production servers to allow for testing at each stage.
3. Employ practices like unit testing, functional testing, and benchmarking to ensure quality and performance as the system grows.
Framework Design Guidelines For Brussels Users Groupbrada
This document summarizes 10 years of experience with framework design guidelines from Microsoft. It discusses core principles of framework design that have remained the same over 10 years, such as layering dependencies and managing types. It also outlines new advances like test-driven development, dependency injection, and tools for dependency management and framework design. The document concludes by emphasizing that framework design principles have stayed consistent while new techniques have emerged to help implement those principles.
Using Query Store in Azure PostgreSQL to Understand Query PerformanceGrant Fritchey
Microsoft has added an excellent new extension in PostgreSQL on their Azure Platform. This session, presented at Posette 2024, covers what Query Store is and the types of information you can get out of it.
SOCRadar's Aviation Industry Q1 Incident Report is out now!
The aviation industry has always been a prime target for cybercriminals due to its critical infrastructure and high stakes. In the first quarter of 2024, the sector faced an alarming surge in cybersecurity threats, revealing its vulnerabilities and the relentless sophistication of cyber attackers.
SOCRadar’s Aviation Industry, Quarterly Incident Report, provides an in-depth analysis of these threats, detected and examined through our extensive monitoring of hacker forums, Telegram channels, and dark web platforms.
Flutter is a popular open source, cross-platform framework developed by Google. In this webinar we'll explore Flutter and its architecture, delve into the Flutter Embedder and Flutter’s Dart language, discover how to leverage Flutter for embedded device development, learn about Automotive Grade Linux (AGL) and its consortium and understand the rationale behind AGL's choice of Flutter for next-gen IVI systems. Don’t miss this opportunity to discover whether Flutter is right for your project.
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesQuickdice ERP
Explore the seamless transition to e-invoicing with this comprehensive guide tailored for Saudi Arabian businesses. Navigate the process effortlessly with step-by-step instructions designed to streamline implementation and enhance efficiency.
Unveiling the Advantages of Agile Software Development.pdfbrainerhub1
Learn about Agile Software Development's advantages. Simplify your workflow to spur quicker innovation. Jump right in! We have also discussed the advantages.
Malibou Pitch Deck For Its €3M Seed Roundsjcobrien
French start-up Malibou raised a €3 million Seed Round to develop its payroll and human resources
management platform for VSEs and SMEs. The financing round was led by investors Breega, Y Combinator, and FCVC.
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...XfilesPro
Wondering how X-Sign gained popularity in a quick time span? This eSign functionality of XfilesPro DocuPrime has many advancements to offer for Salesforce users. Explore them now!
WWDC 2024 Keynote Review: For CocoaCoders AustinPatrick Weigel
Overview of WWDC 2024 Keynote Address.
Covers: Apple Intelligence, iOS18, macOS Sequoia, iPadOS, watchOS, visionOS, and Apple TV+.
Understandable dialogue on Apple TV+
On-device app controlling AI.
Access to ChatGPT with a guest appearance by Chief Data Thief Sam Altman!
App Locking! iPhone Mirroring! And a Calculator!!
3. THE DREAM
Metronomic build/fix/deploy cycle
Bug count always low per release
End users love the app as it never crashes
Stakeholder
QA
Support team
Project Manager
Devs
Imagine a world where
7. THE MISSION: BUILD A MAINTAINABLE
LEGACY
Code spends most of its life being maintained
How hard is it to learn any new code base?
What is your legacy?
My $hit code will be your problem tomorrow
Your $hit code will be my problem today
8. MALLEABLE CODE
Code is rarely done unless it’s demo code
Business requirements change all the time
Code must therefore be engineered to handle continual
refactor
Code must be thought of as highly malleable
Every line is always up for possible refactor
How will you survive dominate in this world?
In The Real World
9. TIP: WRITE UNIT TESTS
Why write tests?
Validate class behaviour now and future proof it
Domain classes with behaviour must have tests
Data classes don’t need tests
Write meaningful tests
Be highly suspicious of 100% unit test coverage
Be judicious; spend money where needed
Write tons of tests for critical algorithm
Don’t write tons of tests for 3 line method
Learn TDD then Practice TDD
10. TIP: AVOID WRITING GOD CLASSES
“A ‘God Class’ is an object that controls way too many
other objects in the system and has grown beyond all logic
to become The Class That Does Everything.”
[http://c2.com/cgi/wiki?GodClass]
The signs
1200 SLOC? 50 private methods? 35 fields?
No one in the team understands how it works?
The disease
11. GOD CLASS: UNIT TESTS HARD TO WRITE?
Class is hard to test?
Lots of complicated test setup code?
Lots of Asserts per test?
A unit test should only have a single Assert
Unit test on Elm Street
12. TIP: ADOPT SINGLE RESPONSIBILITY
PRINCIPLE
Class should have one responsibility
Refactor God class into multiple SRP classes
Write unit tests for each SRP class
The cure
13. TIP: AVOID UNMANAGED COMPLEXITY
Signals: Many lines of code, tons of methods but few
classes
Avoid function decomposition
Private method syndrome
Private methods cannot be unit tested
Embrace class decomposition
Lots of little classes
Write battery of unit tests for each little class
Refactor big private methods out into their own class (see
‘method-object’ Kent Beck)
14. TIP: USE SOFTWARE DESIGN PATTERNS
Don’t miss out on GOF patterns
Factory, Null Object, Decorator, Adapter etc
Patterns signal intent to other developers
Use only when needed
Don’t force them in when not needed
Be suspicious of large code base that doesn’t use patterns
Beware Dunning-Kruger Effect
15. CYCLOMATIC COMPLEXITY
“Cyclomatic complexity is a software metric
(measurement), used to indicate the complexity of a
program. It is a quantitative measure of the number of
linearly independent paths through a program's source
code.”
[https://en.wikipedia.org/wiki/Cyclomatic_complexity]
16. TIP: REDUCE HEAVY USE OF IMPERATIVE
STYLE
Complicated code is hard to understand
Nested if/else with lots of || and &&
Cyclomatic complexity is the work of the devil
Reduce use of imperative programming style
e.g. if/else/switch
Flock of seagulls lead to the gates to Hades {{{}}}
Challenge each other to reduce heavy use of them
Good use of OO, LINQ & patterns will help achieve this goal
Favour a functional programming style
e.g. LINQ
But avoid nested lambda hell
17. TIP: PUBLISH CYCLOMATIC COMPLEXITY
Dashboards like Sonar publish cyclomatic complexity
during the build for all to see
Visual Studio “Code Metrics” gives cyclomatic complexity
drill down
ReSharper add-on can graphically show cyclomatic
complexity in Visual Studio
19. TIP: AVOID STATIC
Static references & classes defeat unit testing
E.g. How do you mock DateTime.Now for daylight savings
unit tests when they run on January 14th?
Wrap use of static classes in an injected singleton that
delegates to static implementation
E.g. Define and implement IDateTime interface
Avoid ‘XyzHelper’ or ‘Util’ classes like the plague!
20. TIP: USE AWESOME NAMES EVERYWHERE
Take time to name every artefact
Class, method, field, property, parameter, automatic variable (prod
code + test code)
Class name is a noun
Method name is a verb
E.g. dog.Sleep(), table.Clear(),
documentAggregator.Aggregate()
Stuck for class name? http://classnamer.org
E.g.
for(int p = 0; p < 10; p++) {}
for(int personIndex = 0; personIndex < 10;
personIndex++) {}
21. TIP: WRITE CLEAN CODE
Broken Window Theory
“maintaining and monitoring urban environments to preve
nt small crimes such as vandalism, public drinking and toll
-
jumping helps to create an atmosphere of order and lawful
ness, thereby preventing more serious crimes from
happening”
Corollary: Keep code+tests uber clean
[https://en.wikipedia.org/wiki/Broken_windows_theory]
Uncle Bob says ‘Keep it clean!’
22. TIP: AVOID INHERITANCE
Default to avoid inheritance: ‘is-a’
Why? Derived often needs to know base intimately
Default to favour composition: ‘has-a’
Only cave-in when ‘is-a’ rule satisfied
Dog is-a bone: fail
Dog has-a bone: pass
Cat is-a mammal: pass
Cat has-a mammal: fail
23. TIP: CODE REVIEW BEFORE CHECK-IN
Ideally every check-in gets peer reviewed prior to
check-in
Each check-in should have:
Description + name of reviewer
Over the shoulder review preferential
Rotate reviewers and share knowledge and tips within the
team == free peer training; level up
Also back up with post commit code review tool e.g.
Crucible
24. TIP: HOW TO CONDUCT CODE REVIEW
1. Park egos at the door
2. Team first attitude
3. Test coverage good?
4. Lots of private methods? God class?
5. Inheritance satisfies ‘is-a’ rule?
6. Interface based programming? Use of ‘new’ operator?
7. Good class/method/field/prop/auto names?
25. TIP: USE INVERSION OF CONTROL
Domain class constructor takes interface
parameters only (C#)
Don’t new domain class from within domain class
(fine to new framework classes e.g. List<T>,
Hashset<T> etc)
Why? Testing class A would be implicit test of B as well
Constructor stores interface parameter in field
Constructor does nothing else
Why? Interface can easily be mocked therefore easy to
test
Use 2-phase construction via Initialize() method if needed
27. TIP: AVOID CODE COMMENTS
Comments are very useful for big and complicated things
Warning: Comments quickly get out of date with respect to
code during refactor
Comments not necessary for small and easy to understand
things
Corollary: Only create small, easy to understand well
named things and therefore ditch comments
28. TIP: AVOID EXCESSIVE NULL CHECKING
Excessive null checking is a Code smell
if (dog != null) {} OR if (dog == null)
Consider Null Object Pattern
30. TIP: CONFORM TO A SIMPLE CODE
STANDARD
Author a 1 page annotated coding standard
Why? If it all looks like it was written by one person then
it’s going to be easier maintain/learn
Get dev buy-in by building team consensus on
content
Print it off for everyone to put on the wall by their desk
Police it with code review
Use tooling: e.g. Write a Resharper standard and share
with the team
31. TIP: PRACTICE INTERFACE BASED
PROGRAMMING
Every domain class should should be accompanied by an
interface
What is a domain class?
One that has behaviour
Pass IDogController around, not DogController
Why? Decrease coupling between classes
32. TIP: USE MULTIPLE METHOD RETURNS
In the old days single method return was
Why? Because of long complicated methods in God classes
Requires carefully nested method if/else hierarchy
If you don’t have God classes with long complicated
methods then you have no fear of multiple method returns
any more
Why? Simpler to read due to dramatic reduction in nested
if/else hierarchy
33. TIP: AVOID C# REGIONS
Regions (#region) are a great place to hide code
Often commented out code can be found hiding in them
God classes often lurk within regions pretending to not be
God classes Grrrrr
34. TIP: AVOID SPECULATIVE GENERALITY
App developers are often wannabe framework developers
Allow base classes to emerge from ongoing requirements
Don’t try and predict the future now
Avoid marking a method as virtual unless there is a class
to override it right now
35. TIP: BUY RESHARPER LICENSES
All C# devs should use ReSharper
Essential for quick and accurate refactoring
Set up shared team coding style
Reformat class(es) automatically before check-in
Find type
Find implementation of interface/method
Refactor name of class/method/field/auto etc
36. TIP: LEARN ALL LANGUAGE FEATURES
Polymorphism: check
Interface based programming: check
Generics: check
Iterators: check
LINQ: check
async/await: check
C#
37. TIP: HIRE QUALITY-MINDED ENGINEERS
Do they care about code quality? Ask them!
When was the last time they checked-in a unit test?
Prove it! Get them to write an algorithm on the white
board and a unit test for it
Get them to come up with the list of tests they would write
for the algorithm
Ensure good CS background: data structures & algorithms
Make sure they really know all the latest stuff (passion)
Never hire a ‘maybe’
Ensure good team fit – everyone meets the candidate
38. CALL TO ACTION
Code quality directly impacts $takeholder through to end
user experience
Up the ante: Make code quality your mission
Write good quality unit tests
Maintain a hygienic code base (inc tests)
Build a legacy your team is proud of that your users will
love
39. REFERENCES
Clean Code: A Handbook of Agile Software Craftsmanship,
Robert C Martin aka Uncle Bob
Awesome google talk (Misko Hevery)
http://www.youtube.com/watch?v=acjvKJiOvXw