1. The document discusses designing code for testability. It emphasizes dependency injection and mocking to easily instantiate classes and invoke methods during testing without dependencies.
2. It also discusses avoiding private and static methods when possible since they cannot be overridden or replaced, making the code harder to test. Following good design practices like the SOLID principles leads to more testable code.
3. The document provides examples of refactoring code to make it more testable through dependency injection and interfaces. This allows dependencies to be mocked or stubbed during testing and makes the code easier to extend.
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.
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.
Getting Started with Test-Driven Development at Longhorn PHP 2023Scott Keck-Warren
Test-driven development (TDD) is a software development process where test cases are written before code to validate requirements. The TDD process involves short cycles of adding a test, making it fail, making it pass, and refactoring code. Using TDD generates an automated test suite that gives developers confidence to refactor and change code quickly. Unit tests validate individual code units in isolation while feature tests validate code as a user would interact with it. Code coverage metrics help ensure tests cover enough of the codebase.
TDD is a design technique where tests are written before code to determine requirements. The Red-Green-Refactor process is followed: 1) Write a test that fails (red), 2) Write minimum code to pass the test (green), 3) Refactor code. TDD ensures quality, keeps code simple and testable, and allows for rapid change. Writing tests first helps design by clarifying requirements and preventing bugs.
Test-driven development (TDD) is an agile software development process where test cases are developed before code. The TDD process involves writing a test, watching it fail, writing code to pass the test, and refactoring code as needed. TDD encourages dividing work into small pieces and promotes high-quality code by requiring tests to pass before adding new features. While TDD requires more initial time writing tests, it can reduce debugging time and defects in the long run.
The document discusses unit testing in Grails using the Spock testing framework. It covers the basics of unit testing including goals, advantages, and challenges. It then provides an overview of Spock and examples of writing unit tests in Spock including mocking methods, domains, configurations, and dependencies. The document also discusses how to write unit tests for controllers and integration tests in Grails using Spock.
The document discusses mutation testing as a way to evaluate test effectiveness beyond just code coverage metrics. It introduces the concept of mutation testing, where automated tools make small changes or "mutations" to the production code and tests are run to see if they can detect the changes. This helps identify weaknesses or gaps in test coverage. The document provides examples of mutation tools for Java and other languages and tips for getting started with mutation testing, including performance tweaking and integrating it into continuous integration pipelines. Mutation testing can help improve test quality, especially for safety critical systems, but should start small and be tweaked for performance.
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.
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.
Getting Started with Test-Driven Development at Longhorn PHP 2023Scott Keck-Warren
Test-driven development (TDD) is a software development process where test cases are written before code to validate requirements. The TDD process involves short cycles of adding a test, making it fail, making it pass, and refactoring code. Using TDD generates an automated test suite that gives developers confidence to refactor and change code quickly. Unit tests validate individual code units in isolation while feature tests validate code as a user would interact with it. Code coverage metrics help ensure tests cover enough of the codebase.
TDD is a design technique where tests are written before code to determine requirements. The Red-Green-Refactor process is followed: 1) Write a test that fails (red), 2) Write minimum code to pass the test (green), 3) Refactor code. TDD ensures quality, keeps code simple and testable, and allows for rapid change. Writing tests first helps design by clarifying requirements and preventing bugs.
Test-driven development (TDD) is an agile software development process where test cases are developed before code. The TDD process involves writing a test, watching it fail, writing code to pass the test, and refactoring code as needed. TDD encourages dividing work into small pieces and promotes high-quality code by requiring tests to pass before adding new features. While TDD requires more initial time writing tests, it can reduce debugging time and defects in the long run.
The document discusses unit testing in Grails using the Spock testing framework. It covers the basics of unit testing including goals, advantages, and challenges. It then provides an overview of Spock and examples of writing unit tests in Spock including mocking methods, domains, configurations, and dependencies. The document also discusses how to write unit tests for controllers and integration tests in Grails using Spock.
The document discusses mutation testing as a way to evaluate test effectiveness beyond just code coverage metrics. It introduces the concept of mutation testing, where automated tools make small changes or "mutations" to the production code and tests are run to see if they can detect the changes. This helps identify weaknesses or gaps in test coverage. The document provides examples of mutation tools for Java and other languages and tips for getting started with mutation testing, including performance tweaking and integrating it into continuous integration pipelines. Mutation testing can help improve test quality, especially for safety critical systems, but should start small and be tweaked for performance.
Unit Testing Basics discusses the definition, types, benefits, and best practices of unit testing. The key points are:
- Unit tests verify small elements of code like classes or methods and have characteristics like being fast, isolated, repeatable, and self-checking.
- Different types of tests include unit tests, component tests, system tests, and functional tests which test at different scopes and have varying execution times.
- Well-designed unit tests provide benefits like documentation, error detection, and code improvements. Tests should be written before code using techniques like test-driven development.
- Frameworks like EasyMock can be used to create test doubles and mock objects to isolate the system under test and verify
In this session, you will enter the world of mutation testing. By generating mutants, that is, faulty versions of your code, you can measure how well your tests can detect bugs. You will learn about mutation tools, how they work, and how to get started, as well as when you should consider mutation testing. Want better code that is well tested? Come to this session!
Intro To JavaScript Unit Testing - Ran MizrahiRan Mizrahi
The document introduces JavaScript testing and test-driven development (TDD). It discusses why software projects fail, challenges of testing JavaScript code, and how to use the Mocha and ChaiJS frameworks for TDD and behavior-driven development (BDD). It provides an example of writing unit tests for a user service function using TDD principles, implementing the code to pass the tests, and running the tests with Mocha. Benefits of testing code include short feedback cycles, high test coverage, documentation of specifications, and less time spent debugging.
This document discusses test driven development and unit testing. It begins with an agenda that includes the importance of unit testing, test driven development techniques, and unit testing in .NET and Eclipse. It then covers topics like the definition of a unit, myths about unit testing, how test driven development works in short cycles, and metrics for test usage. Finally, it discusses techniques like common test patterns, using mock objects, and unit testing frameworks like NUnit, MSTest, Moq and features in Visual Studio and Eclipse.
The document discusses tools and techniques for making Java development more enjoyable. It recommends using libraries like Mockito, Guice and Guava to simplify testing and dependency injection. It also suggests using builder patterns, writing concise yet descriptive unit tests, and avoiding string-typing in favor of object-oriented types.
The document discusses testing in Android applications. It recommends moving as much logic as possible to the Java Virtual Machine (JVM) to allow for easier unit testing. This includes business logic, models, and network code using Retrofit. It also suggests using Espresso for UI testing on Android and monkeyrunner for basic OS interaction testing. The document acknowledges testing on Android can be painful due to speed and fragmentation issues, and proposes compromises like helping quality assurance engineers with tools like the Bee library.
We Are All Testers Now: The Testing Pyramid and Front-End DevelopmentAll Things Open
The document provides an overview of test-driven development (TDD) principles and how to implement testing for front-end development. It discusses the benefits of TDD, such as avoiding bad designs and preventing regressions. It also addresses common challenges with TDD, like slowing initial velocity and ignored tests over time. The document then covers different levels of testing, including unit tests, integration tests, and functional/end-to-end tests using the testing pyramid as a framework. It provides examples of writing tests for pure and impure functions using the Jest testing framework. Finally, it discusses functional testing using Cucumber.js behavior-driven development.
This document provides an agenda and overview for a mobile agile testing workshop covering both Android and iOS testing. The Android section covers unit, UI, and API testing tools like JUnit, Espresso, and Postman. It also discusses test-driven development. The iOS section similarly covers unit testing with XCTest, UI testing with XCUI, mocking with Cuckoo, and tools like Postman and Jenkins. The document emphasizes why testing is important for catching bugs, making changes confidently, and extending the lifespan of codebases.
This Webinar explores a variety of new and updated features in Java 8, and discuss how these changes can positively impact your day-to-day programming.
Watch the video replay here: http://bit.ly/1vStxKN
Your Webinar presenter, Marnie Knue, is an instructor for Develop Intelligence and has taught Sun & Oracle certified Java classes, RedHat JBoss administration, Spring, and Hibernate. Marnie also has spoken at JavaOne.
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...GlobalLogic Ukraine
16 грудня 2021 року відбувся GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Personal Skill”! Анатолій Сахно (Software Testing Consultant, GlobalLogic) розібрав принципи TDD (розробки, керованої тестами) та приклади їх застосування. Крім того, поговорили про:
- Ефективне використання модульних тестів у повсякденних задачах;
- Використання TDD при розробці тестових фреймворків;
- Застосування принципів TDD при написанні функціональних автотестів.
Більше про захід: https://www.globallogic.com/ua/about/events/globallogic-test-automation-online-techtalk-test-driven-development-as-a-personal-skill/
Приємного перегляду і не забудьте залишити коментар про враження від TechTalk!
Ця активність — частина заходів в рамках GlobalLogic Test Automation Advent Calendar, ще більше заходів та цікавинок за посиланням: https://bit.ly/AdventCalendar_fb
The document provides an overview of testing Apex code in Salesforce, including:
- Why unit testing is important for developing robust, error-free code that meets the minimum 75% test coverage requirement.
- How to write Apex test classes annotated with @isTest and define test methods using testMethod.
- Using Test.startTest() and Test.stopTest() to test governor limits.
- Examples of testing a trigger, visualforce controller, web services callouts, and external API callouts.
- Best practices for testing such as using System.assert(), achieving 100% coverage, and testing different user contexts with System.runAs().
Unit testing with RSpec is a tool for testing Ruby code using a behavior-driven development approach. RSpec allows writing unit tests to test models, controllers, helpers and other code. Writing unit tests brings advantages like confidence in deploying code, documenting how code works, and catching errors. RSpec provides features for testing including describing test contexts and expectations, factories for test data, mocking and stubbing, and spying on method calls.
The document discusses assessing unit test quality and describes a project called PEA that aims to collect and report metrics around test directness and assertion density. It outlines various approaches tried for PEA, including static code analysis, bytecode instrumentation, aspect-oriented programming, and using a debugger. The preferred approach ended up being to use the Java Platform Debugger Architecture to monitor tests running in another JVM without modifying code.
Software testing
Developers Belief on Software Testing
Developers Responsibility for testing
Test writing methods
State based testing
Behavioural/interaction based testing
Writing a Testable Code
Flaw 1 - Constructor does Real Work
Flaw 2 - API lies about it's real dependencies
Flaw 3 - Brittle Global State & Singletons
Testing Frameworks and tools for Java...
Mockito and PowerMock...
Testing Models
Stubs Based Testing Model
Mocked Objects Based Testing Model
JUit 4.+ and TestNG
https://www.adroitlogic.com
https://developer.adroitlogic.com
This document discusses various techniques for unit testing in Java with JUnit, including naming tests clearly, using Hamcrest matchers for assertions, writing parameterized tests, using JUnit rules, and measuring code coverage. It provides examples of how to write tests that follow best practices and leverage JUnit's capabilities for parameterized testing, timeouts, error collection, and more. It also discusses running tests in parallel and measuring code coverage in IDEs like IntelliJ and Eclipse.
How I Learned to Stop Worrying and Love Legacy CodeGene Gotimer
Many developers would love to work on brand-new, cutting-edge, greenfield projects, never dealing with the mess of unintelligible code someone else left behind. But most of us spend most of our time maintaining existing code, and it is often spaghetti code with no unit tests, no documentation, and, if we are lucky, a comment that says, “Not sure how this works, but it does so don’t touch it.” We need to make changes, but we can’t even figure out what the code is supposed to do. You know your changes will pile on and make it worse. You can’t change the code safely without adding tests, but you can’t add tests without making changes. So how do you tackle this chicken-and-egg problem? You do it slowly and methodically, building a safety net along the way.
Join Gene as he talks about helping to maintain and improve code on an infamous software project- it was so bad it made the national news. He’ll explain his approach to breaking the code into manageable, maintainable chunks. He’ll talk about adding unit tests that actually test the code using mutation testing- one of his favorite subjects. If you have inherited a pile of code and want to clean it up into something you aren’t afraid to touch, this talk is for you. You’ll hear about some tools and approaches to help you turn legacy code into code you don’t hate.
The document discusses unit testing with the Spock testing framework. It introduces Spock and outlines key concepts like the three pillars of good unit tests, Spock idioms, mocks and stubs, and continuous integration. Spock provides an expressive testing language based on Groovy that makes tests more readable, maintainable and trustworthy. Examples demonstrate how to write feature methods, use blocks, verify interactions, stub implementations, test exceptions, integrate with Spring, and perform HTTP calls and data-driven testing with Spock.
Mutation testing involves deliberately injecting faults into a program and running test cases to determine if they can detect the faults. It is a technique for evaluating test suite quality. Key aspects include generating mutant programs by making small syntactic changes to the original, running test cases against mutants, and calculating a mutation score based on the percentage of mutants detected. While useful for evaluation, mutation testing has limitations such as requiring significant computing resources and not accounting for equivalent or trivial mutants.
Artificial neural networks (ANNs) are a subset of machine learning algorithms inspired by the human brain. ANNs consist of interconnected artificial neurons that can learn complex patterns from data. The document introduces ANNs and perceptrons, the simplest type of ANN for binary classification. It discusses how perceptrons use weighted inputs and an activation function to make predictions. The perceptron learning rule is then explained, showing how weights are updated during training to minimize errors by calculating delta weights through gradient descent. This allows perceptrons to learn logical functions like AND, OR, and NOT from examples.
Unit Testing Basics discusses the definition, types, benefits, and best practices of unit testing. The key points are:
- Unit tests verify small elements of code like classes or methods and have characteristics like being fast, isolated, repeatable, and self-checking.
- Different types of tests include unit tests, component tests, system tests, and functional tests which test at different scopes and have varying execution times.
- Well-designed unit tests provide benefits like documentation, error detection, and code improvements. Tests should be written before code using techniques like test-driven development.
- Frameworks like EasyMock can be used to create test doubles and mock objects to isolate the system under test and verify
In this session, you will enter the world of mutation testing. By generating mutants, that is, faulty versions of your code, you can measure how well your tests can detect bugs. You will learn about mutation tools, how they work, and how to get started, as well as when you should consider mutation testing. Want better code that is well tested? Come to this session!
Intro To JavaScript Unit Testing - Ran MizrahiRan Mizrahi
The document introduces JavaScript testing and test-driven development (TDD). It discusses why software projects fail, challenges of testing JavaScript code, and how to use the Mocha and ChaiJS frameworks for TDD and behavior-driven development (BDD). It provides an example of writing unit tests for a user service function using TDD principles, implementing the code to pass the tests, and running the tests with Mocha. Benefits of testing code include short feedback cycles, high test coverage, documentation of specifications, and less time spent debugging.
This document discusses test driven development and unit testing. It begins with an agenda that includes the importance of unit testing, test driven development techniques, and unit testing in .NET and Eclipse. It then covers topics like the definition of a unit, myths about unit testing, how test driven development works in short cycles, and metrics for test usage. Finally, it discusses techniques like common test patterns, using mock objects, and unit testing frameworks like NUnit, MSTest, Moq and features in Visual Studio and Eclipse.
The document discusses tools and techniques for making Java development more enjoyable. It recommends using libraries like Mockito, Guice and Guava to simplify testing and dependency injection. It also suggests using builder patterns, writing concise yet descriptive unit tests, and avoiding string-typing in favor of object-oriented types.
The document discusses testing in Android applications. It recommends moving as much logic as possible to the Java Virtual Machine (JVM) to allow for easier unit testing. This includes business logic, models, and network code using Retrofit. It also suggests using Espresso for UI testing on Android and monkeyrunner for basic OS interaction testing. The document acknowledges testing on Android can be painful due to speed and fragmentation issues, and proposes compromises like helping quality assurance engineers with tools like the Bee library.
We Are All Testers Now: The Testing Pyramid and Front-End DevelopmentAll Things Open
The document provides an overview of test-driven development (TDD) principles and how to implement testing for front-end development. It discusses the benefits of TDD, such as avoiding bad designs and preventing regressions. It also addresses common challenges with TDD, like slowing initial velocity and ignored tests over time. The document then covers different levels of testing, including unit tests, integration tests, and functional/end-to-end tests using the testing pyramid as a framework. It provides examples of writing tests for pure and impure functions using the Jest testing framework. Finally, it discusses functional testing using Cucumber.js behavior-driven development.
This document provides an agenda and overview for a mobile agile testing workshop covering both Android and iOS testing. The Android section covers unit, UI, and API testing tools like JUnit, Espresso, and Postman. It also discusses test-driven development. The iOS section similarly covers unit testing with XCTest, UI testing with XCUI, mocking with Cuckoo, and tools like Postman and Jenkins. The document emphasizes why testing is important for catching bugs, making changes confidently, and extending the lifespan of codebases.
This Webinar explores a variety of new and updated features in Java 8, and discuss how these changes can positively impact your day-to-day programming.
Watch the video replay here: http://bit.ly/1vStxKN
Your Webinar presenter, Marnie Knue, is an instructor for Develop Intelligence and has taught Sun & Oracle certified Java classes, RedHat JBoss administration, Spring, and Hibernate. Marnie also has spoken at JavaOne.
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...GlobalLogic Ukraine
16 грудня 2021 року відбувся GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Personal Skill”! Анатолій Сахно (Software Testing Consultant, GlobalLogic) розібрав принципи TDD (розробки, керованої тестами) та приклади їх застосування. Крім того, поговорили про:
- Ефективне використання модульних тестів у повсякденних задачах;
- Використання TDD при розробці тестових фреймворків;
- Застосування принципів TDD при написанні функціональних автотестів.
Більше про захід: https://www.globallogic.com/ua/about/events/globallogic-test-automation-online-techtalk-test-driven-development-as-a-personal-skill/
Приємного перегляду і не забудьте залишити коментар про враження від TechTalk!
Ця активність — частина заходів в рамках GlobalLogic Test Automation Advent Calendar, ще більше заходів та цікавинок за посиланням: https://bit.ly/AdventCalendar_fb
The document provides an overview of testing Apex code in Salesforce, including:
- Why unit testing is important for developing robust, error-free code that meets the minimum 75% test coverage requirement.
- How to write Apex test classes annotated with @isTest and define test methods using testMethod.
- Using Test.startTest() and Test.stopTest() to test governor limits.
- Examples of testing a trigger, visualforce controller, web services callouts, and external API callouts.
- Best practices for testing such as using System.assert(), achieving 100% coverage, and testing different user contexts with System.runAs().
Unit testing with RSpec is a tool for testing Ruby code using a behavior-driven development approach. RSpec allows writing unit tests to test models, controllers, helpers and other code. Writing unit tests brings advantages like confidence in deploying code, documenting how code works, and catching errors. RSpec provides features for testing including describing test contexts and expectations, factories for test data, mocking and stubbing, and spying on method calls.
The document discusses assessing unit test quality and describes a project called PEA that aims to collect and report metrics around test directness and assertion density. It outlines various approaches tried for PEA, including static code analysis, bytecode instrumentation, aspect-oriented programming, and using a debugger. The preferred approach ended up being to use the Java Platform Debugger Architecture to monitor tests running in another JVM without modifying code.
Software testing
Developers Belief on Software Testing
Developers Responsibility for testing
Test writing methods
State based testing
Behavioural/interaction based testing
Writing a Testable Code
Flaw 1 - Constructor does Real Work
Flaw 2 - API lies about it's real dependencies
Flaw 3 - Brittle Global State & Singletons
Testing Frameworks and tools for Java...
Mockito and PowerMock...
Testing Models
Stubs Based Testing Model
Mocked Objects Based Testing Model
JUit 4.+ and TestNG
https://www.adroitlogic.com
https://developer.adroitlogic.com
This document discusses various techniques for unit testing in Java with JUnit, including naming tests clearly, using Hamcrest matchers for assertions, writing parameterized tests, using JUnit rules, and measuring code coverage. It provides examples of how to write tests that follow best practices and leverage JUnit's capabilities for parameterized testing, timeouts, error collection, and more. It also discusses running tests in parallel and measuring code coverage in IDEs like IntelliJ and Eclipse.
How I Learned to Stop Worrying and Love Legacy CodeGene Gotimer
Many developers would love to work on brand-new, cutting-edge, greenfield projects, never dealing with the mess of unintelligible code someone else left behind. But most of us spend most of our time maintaining existing code, and it is often spaghetti code with no unit tests, no documentation, and, if we are lucky, a comment that says, “Not sure how this works, but it does so don’t touch it.” We need to make changes, but we can’t even figure out what the code is supposed to do. You know your changes will pile on and make it worse. You can’t change the code safely without adding tests, but you can’t add tests without making changes. So how do you tackle this chicken-and-egg problem? You do it slowly and methodically, building a safety net along the way.
Join Gene as he talks about helping to maintain and improve code on an infamous software project- it was so bad it made the national news. He’ll explain his approach to breaking the code into manageable, maintainable chunks. He’ll talk about adding unit tests that actually test the code using mutation testing- one of his favorite subjects. If you have inherited a pile of code and want to clean it up into something you aren’t afraid to touch, this talk is for you. You’ll hear about some tools and approaches to help you turn legacy code into code you don’t hate.
The document discusses unit testing with the Spock testing framework. It introduces Spock and outlines key concepts like the three pillars of good unit tests, Spock idioms, mocks and stubs, and continuous integration. Spock provides an expressive testing language based on Groovy that makes tests more readable, maintainable and trustworthy. Examples demonstrate how to write feature methods, use blocks, verify interactions, stub implementations, test exceptions, integrate with Spring, and perform HTTP calls and data-driven testing with Spock.
Mutation testing involves deliberately injecting faults into a program and running test cases to determine if they can detect the faults. It is a technique for evaluating test suite quality. Key aspects include generating mutant programs by making small syntactic changes to the original, running test cases against mutants, and calculating a mutation score based on the percentage of mutants detected. While useful for evaluation, mutation testing has limitations such as requiring significant computing resources and not accounting for equivalent or trivial mutants.
Artificial neural networks (ANNs) are a subset of machine learning algorithms inspired by the human brain. ANNs consist of interconnected artificial neurons that can learn complex patterns from data. The document introduces ANNs and perceptrons, the simplest type of ANN for binary classification. It discusses how perceptrons use weighted inputs and an activation function to make predictions. The perceptron learning rule is then explained, showing how weights are updated during training to minimize errors by calculating delta weights through gradient descent. This allows perceptrons to learn logical functions like AND, OR, and NOT from examples.
The document describes a scenario involving four men sentenced to death who must guess the color of their hats to survive. They are lined up without being able to see each other's hats or communicate. Person D does not answer in the first minute, allowing person C to deduce that D saw hats of two different colors in front of him. Therefore, if person B has a white hat, person C must have a black hat, and vice versa. This allows one of them to correctly guess the color of their hat and survive.
A deep introduction to supervised and unsupervised Machine Learning with examples in R.
Techniques covered for Regression:
- Linear Regression
- Polynomial Regression
Techniques covered for Classification:
- Simple and Multiple Logistic Regression
- Linear and Quadratic Discriminant Analysis
- K-Nearest Neighbors
Clustering:
- K-Means clustering
- Hierarchical clustering
Mahout is an open source machine learning java library from Apache Software Foundation, and therefore platform independent, that provides a fertile framework and collection of patterns and ready-made component for testing and deploying new large-scale algorithms.
With these slides we aims at providing a deeper understanding of its architecture.
Software has bugs and it seems to be unavoidable. To find them we often use code reviews and software testing. However, test an application and find no bugs does not mean the application is correct. Model checking is an automatic technique that can guarantee the absence of bugs (i.e. the correctness of a system) given a formal specification. This presentation shows the results of an empirical study on Bounded Model Checking in security context to verify its ability in identifying vulnerable code regions where multiple vulnerabilities in the code can affect each other in their detection.
The document discusses several modeling techniques used in software development including the Unified Modeling Language (UML), Entity-Relationship (ER) modeling, and dimensional modeling. It provides an overview of UML diagrams including use case, class, sequence, activity, and other diagrams. It also explains the basic concepts of ER modeling such as entities, attributes, relationships, and cardinalities. Finally, it gives an example of modeling a company database using ER diagrams with entities for departments, projects, employees, and their attributes and relationships.
VCCFinder: Finding Potential Vulnerabilities in Open-Source Projects to Assis...Stefano Dalla Palma
These slides describe the paper of Henning Perl et. al. about a new method of finding potentially dangerous code in code repositories with a significantly lower false-positive rate than comparable systems. They combine code-metric analysis with metadata gathered from code repositories to help code review teams prioritize their work.
Detecting controversy in microposts: an approach based on word similarity wit...Stefano Dalla Palma
Descrizione di ATOMIC, un approccio introduttivo per la rilevazione della controversia nei social media. L'analisi è stata effettuata sulla piattaforma twitter.com.
How Can Hiring A Mobile App Development Company Help Your Business Grow?ToXSL Technologies
ToXSL Technologies is an award-winning Mobile App Development Company in Dubai that helps businesses reshape their digital possibilities with custom app services. As a top app development company in Dubai, we offer highly engaging iOS & Android app solutions. https://rb.gy/necdnt
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.
Consistent toolbox talks are critical for maintaining workplace safety, as they provide regular opportunities to address specific hazards and reinforce safe practices.
These brief, focused sessions ensure that safety is a continual conversation rather than a one-time event, which helps keep safety protocols fresh in employees' minds. Studies have shown that shorter, more frequent training sessions are more effective for retention and behavior change compared to longer, infrequent sessions.
Engaging workers regularly, toolbox talks promote a culture of safety, empower employees to voice concerns, and ultimately reduce the likelihood of accidents and injuries on site.
The traditional method of conducting safety talks with paper documents and lengthy meetings is not only time-consuming but also less effective. Manual tracking of attendance and compliance is prone to errors and inconsistencies, leading to gaps in safety communication and potential non-compliance with OSHA regulations. Switching to a digital solution like Safelyio offers significant advantages.
Safelyio automates the delivery and documentation of safety talks, ensuring consistency and accessibility. The microlearning approach breaks down complex safety protocols into manageable, bite-sized pieces, making it easier for employees to absorb and retain information.
This method minimizes disruptions to work schedules, eliminates the hassle of paperwork, and ensures that all safety communications are tracked and recorded accurately. Ultimately, using a digital platform like Safelyio enhances engagement, compliance, and overall safety performance on site. https://safelyio.com/
UI5con 2024 - Bring Your Own Design SystemPeter Muessig
How do you combine the OpenUI5/SAPUI5 programming model with a design system that makes its controls available as Web Components? Since OpenUI5/SAPUI5 1.120, the framework supports the integration of any Web Components. This makes it possible, for example, to natively embed own Web Components of your design system which are created with Stencil. The integration embeds the Web Components in a way that they can be used naturally in XMLViews, like with standard UI5 controls, and can be bound with data binding. Learn how you can also make use of the Web Components base class in OpenUI5/SAPUI5 to also integrate your Web Components and get inspired by the solution to generate a custom UI5 library providing the Web Components control wrappers for the native ones.
Liberarsi dai framework con i Web Component.pptxMassimo Artizzu
In Italian
Presentazione sulle feature e l'utilizzo dei Web Component nell sviluppo di pagine e applicazioni web. Racconto delle ragioni storiche dell'avvento dei Web Component. Evidenziazione dei vantaggi e delle sfide poste, indicazione delle best practices, con particolare accento sulla possibilità di usare web component per facilitare la migrazione delle proprie applicazioni verso nuovi stack tecnologici.
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!!
Artificia Intellicence and XPath Extension FunctionsOctavian Nadolu
The purpose of this presentation is to provide an overview of how you can use AI from XSLT, XQuery, Schematron, or XML Refactoring operations, the potential benefits of using AI, and some of the challenges we face.
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.
Most important New features of Oracle 23c for DBAs and Developers. You can get more idea from my youtube channel video from https://youtu.be/XvL5WtaC20A
14 th Edition of International conference on computer visionShulagnaSarkar2
About the event
14th Edition of International conference on computer vision
Computer conferences organized by ScienceFather group. ScienceFather takes the privilege to invite speakers participants students delegates and exhibitors from across the globe to its International Conference on computer conferences to be held in the Various Beautiful cites of the world. computer conferences are a discussion of common Inventions-related issues and additionally trade information share proof thoughts and insight into advanced developments in the science inventions service system. New technology may create many materials and devices with a vast range of applications such as in Science medicine electronics biomaterials energy production and consumer products.
Nomination are Open!! Don't Miss it
Visit: computer.scifat.com
Award Nomination: https://x-i.me/ishnom
Conference Submission: https://x-i.me/anicon
For Enquiry: Computer@scifat.com
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfVALiNTRY360
Salesforce Healthcare CRM, implemented by VALiNTRY360, revolutionizes patient management by enhancing patient engagement, streamlining administrative processes, and improving care coordination. Its advanced analytics, robust security, and seamless integration with telehealth services ensure that healthcare providers can deliver personalized, efficient, and secure patient care. By automating routine tasks and providing actionable insights, Salesforce Healthcare CRM enables healthcare providers to focus on delivering high-quality care, leading to better patient outcomes and higher satisfaction. VALiNTRY360's expertise ensures a tailored solution that meets the unique needs of any healthcare practice, from small clinics to large hospital systems.
For more info visit us https://valintry360.com/solutions/health-life-sciences
2. Better safe than sorry
It is better to do something carefully in advance than to su er later
3. Insu icient testing
No documentation
This never ends well
Eeasy to ignore or shortchange,
especially on projects with a
tight budget
Poor code quality
Smells really bad!
Technical debt
The implied cost of additional rework caused by choosing an easy
solution now instead of a better approach that would take longer
4. "Design the so ware to make it more easy to test"
Design for Testability
5. " The degree to which a system facilitates
the establishment of test criteria and the
performance of tests to determine whether
those criteria have been met "
IEEE, 1990 " Having reliable and convenient
interfaces to drive the execution
and verification of tests "
B. Pettichord
" Characteristic of a so ware
which allows it to be easily
and e iciently tested "
(Bach 1999, Gelperin 1999)
Testability
6. Which code is easier to test?
public class MyCalendar {
public boolean isWeekDay(){
int day = Calendar.getInstance()
.get(Calendar.DAY_OF_WEEK);
return day Calendar.SATURDAY
day Calendar.SUNDAY;
}
}
public class MyCalendar {
public boolean isWeekDay(Calendar calendar){
int day = calendar.get(Calendar.DAY_OF_WEEK);
return day Calendar.SATURDAY
day Calendar.SUNDAY;
}
}
7. Types of Testing
Unit Testing Integration Testing System Testing Acceptance Testing
and many others more
01 02 03 04
8. Map the issue to the
solution
Instantiating a class
and invoke methods
Isolation from dependencies Verify interactions
When writing unit tests we usually face some issues, such as
9. Dependency injection
A process used in unit testing when the unit being tested has external
dependencies. It aims to isolate and focus on the code being tested and not on
the behavior or state of the external dependencies
Mocking
A design pattern in which an object or function receives other objects or
functions that it depends on. It aims to separate the concerns of constructing
objects and using them, leading to a loosely coupled program
10. What would you do to easily instantiate classes
and invoke methods during testing?
Dependency injection Mocking Write clean code and avoid
private, final, and static
Question 1/3
Map the issue to a possible solution
11. Question 2/3
How would you prevent a class from
instantiating its own dependencies?
Dependency injection Mocking
Map the issue to a possible solution
Write clean code and avoid
private, final, and static
12. Question 3/3
How would you simulate the behavior of the real
object and eventually verify its interactions?
Dependency injection Mocking
Map the issue to a possible solution
Write clean code and avoid
private, final, and static
14. Be pragmatic and precise while doing it
Write Clean and
SOLID Code
1
15. Clean code
A code than any developer can read and change easily
Testable
Simple
Establish a baseline behaviour
and makes it easier to change
Increasing complexity makes the
code error-prone and di icult to
maintain
Focused
A piece of code should solve
only a specific problem
16. Beware Code Smells
Symptoms of poor design or implementation choices. Classes that experience those symptoms
are more change- and fault-prone than others
Bloaters
Hard to work with due to their
incresed proportions
Couplers
Contribute to excessive
coupling between classes
Long Method Large Class
Long Parameter List
Feature Envy Message Chain
19. " All so ware will be tested - either by you and your
team or by the eventual users - so you might as well
plan on testing it thoroughly "
Andrew Hunt, The Pragmatic Programmer
20. Test-driven development (TDD)
A so ware development approach in which test cases are developed to specify
and validate what the code will do
21. The TDD cycle
public class MyCalendar {
public boolean isWeekDay(Calendar calendar){
int day = calendar.get(Calendar.DAY_OF_WEEK);
return day Calendar.MONDAY day Calendar.TUESDAY
day Calendar.WEDNESDAY day Calendar.THURSDAY
day Calendar.FRIDAY;
}
}
void testIsWeekDay(){
var calendar = Calendar.getInstance()
.set(2022, 8, 2);
assert new MyCalendar().isWeekDay(calendar);
}
}
public class MyCalendar {
public boolean isWeekDay(Calendar calendar){
return false;
}
}
public class MyCalendar {
public boolean isWeekDay(Calendar calendar){
int day = calendar.get(Calendar.DAY_OF_WEEK);
return day Calendar.SATURDAY day Calendar.SUNDAY;
}
}
22. TDD forces you to think about design for testability upfront
TDD forces you to think about design for testability upfront
Not a silver bullet: still focuses on development than testing
Not a silver bullet: still focuses on development than testing
No better way to fix errors than preventing them
No better way to fix errors than preventing them
vs
Test early and o en
Instil a culture of
testing
2
24. public class MyApp {
GithubService githubService = new GithubService();
public int countRepos(String token){
List<String> repos = new ArrayList ();
try{
githubService.authenticate(token);
repos = githubService.collectRepos();
}catch(TimeoutExceeded e){
;
}
return repos.size();
}
}
public class GithubService {
void authenticate(String token) throws TimeoutExceeded {
if(new Random().nextInt(5) 0)
throw new TimeoutExceeded();
Do something, e.g. set APIs quota
}
public List<String> collectRepos(){
return List.of("sdp/myrepo");
}
}
@Test
void testCollectRepos(){
MyApp app = MyApp();
assert app.countRepos("mytoken") 1;
}
@Test
void testCollectReposTimeoutExceeded(){
MyApp app = MyApp();
assert app.countRepos("mytoken") 0;
}
25. MyApp GithubService
Hard-coded dependency
If we want to switch to a different service in the future, e.g., a GitlabService or a
BitbucketService, it will require code changes in MyApp. This makes our
application hard to extend
Testing the application will be very difficult since our application is directly
instantiating the service. There is no way we can mock that object in our tests
27. public class
public class MyApp {
MyApp {
GithubService githubService
GithubService githubService;
;
public
public MyApp(
MyApp(GithubService service
GithubService service){
){
githubService = service;
githubService = service;
}
}
public
public List<String>
List<String> collectRepos
collectRepos(String token){
(String token){
List<String> repos =
List<String> repos = new
new ArrayList ();
ArrayList ();
try
try{
{
githubService.authenticate(token);
githubService.authenticate(token);
repos = githubService.collectRepos()
repos = githubService.collectRepos()
}
}catch
catch(TimeoutExceeded e){
(TimeoutExceeded e){
;
;
}
}
return
return repos.size();
repos.size();
}
}
}
}
public class GithubService {
}
class LazyGithubService extends GithubService {
@Override
void authenticate(String token){
throw new TimeoutExceeded("You know I'm lazy :)");
}
}
@Test
void testCollectReposTimeoutExceeded(){
MyApp app = MyApp(new LazyGithubService());
var repos = app.countRepos("mytoken");
assert repos 0;
}
28. MyApp
GithubService
implementation
RepoHostingService
interface
GitlabService
implementation
public class GithubService implements RepoHostingService
{
@Override
void authenticate(String token){ };
}
public class GitlabService implements RepoHostingService
{
@Override
void authenticate(String token){ };
}
public class
public class MyApp {
MyApp {
RepoHostingService
RepoHostingService service
service;
;
public
public MyApp(
MyApp(RepoHostingService
RepoHostingService service){
service){
this.
this.service = service;
service = service;
}
}
}
}
public interface
public interface RepoHostingService {
RepoHostingService {
void
void authenticate
authenticate(String token);
(String token);
}
}
29. @Test
void testCollectGithubRepos(){
RepoHostingService service = new GithubService();
MyApp app = MyApp(service);
var repos = app.countRepos("mygithubtoken");
assert repos 1;
}
@Test
void testCollectGitlabRepos(){
RepoHostingService service = new GitlabService();
MyApp app = MyApp(service);
var repos = app.countRepos("mygitlabtoken");
assert repos 1;
}
@Test
void testCollectReposTimeoutExceededMock(){
String token = "mytoken";
RepoHostingService service = mock(GithubService.class);
doThrow(new TimeoutExceeded()).when(service)
.authenticate(token);
MyApp app = MyApp(service);
var repos = app.countRepos(token);
assert repos 0;
}
30. MyApp RepoHostingService
Injector GithubService
public class ServiceInjector {
public MyApp getConsumer(String hostingService) {
var service = switch(hostingService) {
case "github" new GithubService();
case "gitlab" new GitlabService();
}
return new MyApp(service);
}
}
31. Eases testing by enabling mocking and stubbing
Eases testing by enabling mocking and stubbing
Eases extension by depending on abstractions
Eases extension by depending on abstractions
vs
With frameworks like Spring, boilerplate code is reduced
With frameworks like Spring, boilerplate code is reduced
If overused can lead to management issues
If overused can lead to management issues
Many compile-time errors are pushed to run-time
Many compile-time errors are pushed to run-time
Tricky to understand at the beginning
Tricky to understand at the beginning
Yet, depend on abstractions, not on concretions
Inject
dependencies
3
33. Protected methods are accessible by the unit test if it is
located in the same package as the unit to test, though
still under a di erent root directory
Turning private
into protected
34. Avoid static methods
Static methods can't be overridden and replaced and
therefore are harder to fake; they require a combination of
frameworks to be tested
35. Write clean and SOLID code
Following good design
practices leads to a more
testable system
Avoid private & static
Private and static methods can't
be overridden and replaced and
therefore are harder to fake
Inject dependencies
This will allow fakes to be
inserted instead of real logic,
making isolation easy
Instil a culture of testing
Early testing guides
(re)design
Design for Testability Recommendations
Avoid code smells
And investigate refactoring
before taking design
decisions
37. What are the recommedation
most import to you...
Create your own standings by sorting the boxes
Avoid code smells
Instil a culture of testing
Inject dependencies
Write clean code
1)
2)
3)
4)
5) Avoid statics & privates
and your questions?