A simple presentation that I did at work that goes over Unit Test, Mocking and TDD to improve development, it is explained from a Java perspective but can be helpful to apply TDD to other languages as well.
JUnit 5 - The Next Generation of JUnit - Ted's Tool TimeTed Vinke
JUnit 5 is the next generation of JUnit. The goal is to create an up-to-date foundation for developer-side testing on the JVM. This includes focusing on Java 8 and above, as well as enabling many different styles of testing.
JUnit 5 - The Next Generation of JUnit - Ted's Tool TimeTed Vinke
JUnit 5 is the next generation of JUnit. The goal is to create an up-to-date foundation for developer-side testing on the JVM. This includes focusing on Java 8 and above, as well as enabling many different styles of testing.
Test driven development - JUnit basics and best practicesNarendra Pathai
A presentation covering all the basics of Software Unit testing using JUnit framework. A lot of best practices, myths misconceptions are covered. Naming conventions for test methods and fundamental requirements for doing sustainable Junit testing.
This presentation describes the some of the major functionality of JUnit4 and TestNG .Each topic contains example so that a viewer can understand the usage and apply them in their code.
Introduction of TestNG framework and its benefits over Junit frameworkBugRaptors
TestNG is a testing framework stirred from NUnit and JUnit but presenting some new functionalities that make it much easier and powerful to use. It is an open source automated testing framework; in which NG means Next Generation. TestNG is much more influential than JUnit but is inspired by JUnit. It is developed to be better than JUnit, specifically while testing integrated classes. We should thank Cedric Beust who has created TestNG.
IT Talk in Odessa for QA Automation/SDET engineers on 26/12/2016:
https://dou.ua/calendar/13626/
https://dataart.ru/events/odessa/it-talk-odessa-testng-vs-junit/
JUnit 4 code on github: https://github.com/a-oleynik/junit-workshop/tree/junit-4.13.2
TestNG code on github: https://github.com/a-oleynik/testng-workshop
Webinar on youtube (it was the next version but only a few slides and details were added): https://www.youtube.com/watch?v=3C-Nu5mkyOQ&t=3189
For informative discussions on software testing please see. http://forum.360logica.com/
Please see description below
360logica is an independent software and application testing services company which provides wide range of testing solutions to our partners based on domain, technology and business solutions including software product testing, quality assurance of software, automation in testing, finance testing, mobile software and applications testing. 360logica offers full range of software testing which include Software Product Testing, Test Automation, Performance Test Engineering, Finance Application Testing, Healthcare App Testing and SaaS Product Testing. We work closely with our partners to tailor a program of support which meets their needs and ensures our systems achieve the quality levels demanded by our partners, especially in financial testing.
Test driven development - JUnit basics and best practicesNarendra Pathai
A presentation covering all the basics of Software Unit testing using JUnit framework. A lot of best practices, myths misconceptions are covered. Naming conventions for test methods and fundamental requirements for doing sustainable Junit testing.
This presentation describes the some of the major functionality of JUnit4 and TestNG .Each topic contains example so that a viewer can understand the usage and apply them in their code.
Introduction of TestNG framework and its benefits over Junit frameworkBugRaptors
TestNG is a testing framework stirred from NUnit and JUnit but presenting some new functionalities that make it much easier and powerful to use. It is an open source automated testing framework; in which NG means Next Generation. TestNG is much more influential than JUnit but is inspired by JUnit. It is developed to be better than JUnit, specifically while testing integrated classes. We should thank Cedric Beust who has created TestNG.
IT Talk in Odessa for QA Automation/SDET engineers on 26/12/2016:
https://dou.ua/calendar/13626/
https://dataart.ru/events/odessa/it-talk-odessa-testng-vs-junit/
JUnit 4 code on github: https://github.com/a-oleynik/junit-workshop/tree/junit-4.13.2
TestNG code on github: https://github.com/a-oleynik/testng-workshop
Webinar on youtube (it was the next version but only a few slides and details were added): https://www.youtube.com/watch?v=3C-Nu5mkyOQ&t=3189
For informative discussions on software testing please see. http://forum.360logica.com/
Please see description below
360logica is an independent software and application testing services company which provides wide range of testing solutions to our partners based on domain, technology and business solutions including software product testing, quality assurance of software, automation in testing, finance testing, mobile software and applications testing. 360logica offers full range of software testing which include Software Product Testing, Test Automation, Performance Test Engineering, Finance Application Testing, Healthcare App Testing and SaaS Product Testing. We work closely with our partners to tailor a program of support which meets their needs and ensures our systems achieve the quality levels demanded by our partners, especially in financial testing.
The presentation contains a definition and survey of the benefits of Unit Testing, and a little coding example to get the feeling of Unit Testing using JUnit, EasyMock and XMLUnit.
Unit Testing Using Mockito in Android (1).pdfKaty Slemon
Learn what is mockito and why to implement Unit Testing using Mockito in Android in this tutorial. You can also visit the Github Source for code implementation
Demonstrate some great aspects of Mockito. Made for Mockito v1.8.5.
All examples can be found @
https://github.com/dodozhang21/MockitoExamples
Ying Zhang (Dodo) http://pure-essence.net
Alexey Buzdin "Maslow's Pyramid of Android Testing"IT Event
You all know what tests are. You all know you need to write them. But also you know it’s hard to start writing tests for mobile app thus you usually neglect it. Let’s look into Android automation testing, what technologies and approaches we can use to have a complete Maslow's Pyramid for testing. Unit Testing, Integration Testing, UI Automation, Mocking etc.
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar
The European Union Agency for Law Enforcement Cooperation (Europol) has suffered an alleged data breach after a notorious threat actor claimed to have exfiltrated data from its systems. Infamous data leaker IntelBroker posted on the even more infamous BreachForums hacking forum, saying that Europol suffered a data breach this month.
The alleged breach affected Europol agencies CCSE, EC3, Europol Platform for Experts, Law Enforcement Forum, and SIRIUS. Infiltration of these entities can disrupt ongoing investigations and compromise sensitive intelligence shared among international law enforcement agencies.
However, this is neither the first nor the last activity of IntekBroker. We have compiled for you what happened in the last few days. To track such hacker activities on dark web sources like hacker forums, private Telegram channels, and other hidden platforms where cyber threats often originate, you can check SOCRadar’s Dark Web News.
Stay Informed on Threat Actors’ Activity on the Dark Web with SOCRadar!
Enterprise Resource Planning System includes various modules that reduce any business's workload. Additionally, it organizes the workflows, which drives towards enhancing productivity. Here are a detailed explanation of the ERP modules. Going through the points will help you understand how the software is changing the work dynamics.
To know more details here: https://blogs.nyggs.com/nyggs/enterprise-resource-planning-erp-system-modules/
Large Language Models and the End of ProgrammingMatt Welsh
Talk by Matt Welsh at Craft Conference 2024 on the impact that Large Language Models will have on the future of software development. In this talk, I discuss the ways in which LLMs will impact the software industry, from replacing human software developers with AI, to replacing conventional software with models that perform reasoning, computation, and problem-solving.
Listen to the keynote address and hear about the latest developments from Rachana Ananthakrishnan and Ian Foster who review the updates to the Globus Platform and Service, and the relevance of Globus to the scientific community as an automation platform to accelerate scientific discovery.
Code reviews are vital for ensuring good code quality. They serve as one of our last lines of defense against bugs and subpar code reaching production.
Yet, they often turn into annoying tasks riddled with frustration, hostility, unclear feedback and lack of standards. How can we improve this crucial process?
In this session we will cover:
- The Art of Effective Code Reviews
- Streamlining the Review Process
- Elevating Reviews with Automated Tools
By the end of this presentation, you'll have the knowledge on how to organize and improve your code review proces
Globus Connect Server Deep Dive - GlobusWorld 2024Globus
We explore the Globus Connect Server (GCS) architecture and experiment with advanced configuration options and use cases. This content is targeted at system administrators who are familiar with GCS and currently operate—or are planning to operate—broader deployments at their institution.
Into the Box Keynote Day 2: Unveiling amazing updates and announcements for modern CFML developers! Get ready for exciting releases and updates on Ortus tools and products. Stay tuned for cutting-edge innovations designed to boost your productivity.
Software Engineering, Software Consulting, Tech Lead.
Spring Boot, Spring Cloud, Spring Core, Spring JDBC, Spring Security,
Spring Transaction, Spring MVC,
Log4j, REST/SOAP WEB-SERVICES.
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Shahin Sheidaei
Games are powerful teaching tools, fostering hands-on engagement and fun. But they require careful consideration to succeed. Join me to explore factors in running and selecting games, ensuring they serve as effective teaching tools. Learn to maintain focus on learning objectives while playing, and how to measure the ROI of gaming in education. Discover strategies for pitching gaming to leadership. This session offers insights, tips, and examples for coaches, team leads, and enterprise leaders seeking to teach from simple to complex concepts.
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Globus
The U.S. Geological Survey (USGS) has made substantial investments in meeting evolving scientific, technical, and policy driven demands on storing, managing, and delivering data. As these demands continue to grow in complexity and scale, the USGS must continue to explore innovative solutions to improve its management, curation, sharing, delivering, and preservation approaches for large-scale research data. Supporting these needs, the USGS has partnered with the University of Chicago-Globus to research and develop advanced repository components and workflows leveraging its current investment in Globus. The primary outcome of this partnership includes the development of a prototype enterprise repository, driven by USGS Data Release requirements, through exploration and implementation of the entire suite of the Globus platform offerings, including Globus Flow, Globus Auth, Globus Transfer, and Globus Search. This presentation will provide insights into this research partnership, introduce the unique requirements and challenges being addressed and provide relevant project progress.
Check out the webinar slides to learn more about how XfilesPro transforms Salesforce document management by leveraging its world-class applications. For more details, please connect with sales@xfilespro.com
If you want to watch the on-demand webinar, please click here: https://www.xfilespro.com/webinars/salesforce-document-management-2-0-smarter-faster-better/
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns
Unlocking Business Potential: Tailored Technology Solutions by Prosigns
Discover how Prosigns, a leading technology solutions provider, partners with businesses to drive innovation and success. Our presentation showcases our comprehensive range of services, including custom software development, web and mobile app development, AI & ML solutions, blockchain integration, DevOps services, and Microsoft Dynamics 365 support.
Custom Software Development: Prosigns specializes in creating bespoke software solutions that cater to your unique business needs. Our team of experts works closely with you to understand your requirements and deliver tailor-made software that enhances efficiency and drives growth.
Web and Mobile App Development: From responsive websites to intuitive mobile applications, Prosigns develops cutting-edge solutions that engage users and deliver seamless experiences across devices.
AI & ML Solutions: Harnessing the power of Artificial Intelligence and Machine Learning, Prosigns provides smart solutions that automate processes, provide valuable insights, and drive informed decision-making.
Blockchain Integration: Prosigns offers comprehensive blockchain solutions, including development, integration, and consulting services, enabling businesses to leverage blockchain technology for enhanced security, transparency, and efficiency.
DevOps Services: Prosigns' DevOps services streamline development and operations processes, ensuring faster and more reliable software delivery through automation and continuous integration.
Microsoft Dynamics 365 Support: Prosigns provides comprehensive support and maintenance services for Microsoft Dynamics 365, ensuring your system is always up-to-date, secure, and running smoothly.
Learn how our collaborative approach and dedication to excellence help businesses achieve their goals and stay ahead in today's digital landscape. From concept to deployment, Prosigns is your trusted partner for transforming ideas into reality and unlocking the full potential of your business.
Join us on a journey of innovation and growth. Let's partner for success with Prosigns.
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamtakuyayamamoto1800
In this slide, we show the simulation example and the way to compile this solver.
In this solver, the Helmholtz equation can be solved by helmholtzFoam. Also, the Helmholtz equation with uniformly dispersed bubbles can be simulated by helmholtzBubbleFoam.
In software engineering, the right architecture is essential for robust, scalable platforms. Wix has undergone a pivotal shift from event sourcing to a CRUD-based model for its microservices. This talk will chart the course of this pivotal journey.
Event sourcing, which records state changes as immutable events, provided robust auditing and "time travel" debugging for Wix Stores' microservices. Despite its benefits, the complexity it introduced in state management slowed development. Wix responded by adopting a simpler, unified CRUD model. This talk will explore the challenges of event sourcing and the advantages of Wix's new "CRUD on steroids" approach, which streamlines API integration and domain event management while preserving data integrity and system resilience.
Participants will gain valuable insights into Wix's strategies for ensuring atomicity in database updates and event production, as well as caching, materialization, and performance optimization techniques within a distributed system.
Join us to discover how Wix has mastered the art of balancing simplicity and extensibility, and learn how the re-adoption of the modest CRUD has turbocharged their development velocity, resilience, and scalability in a high-growth environment.
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...Juraj Vysvader
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I didn't get rich from it but it did have 63K downloads (powered possible tens of thousands of websites).
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Globus
Large Language Models (LLMs) are currently the center of attention in the tech world, particularly for their potential to advance research. In this presentation, we'll explore a straightforward and effective method for quickly initiating inference runs on supercomputers using the vLLM tool with Globus Compute, specifically on the Polaris system at ALCF. We'll begin by briefly discussing the popularity and applications of LLMs in various fields. Following this, we will introduce the vLLM tool, and explain how it integrates with Globus Compute to efficiently manage LLM operations on Polaris. Attendees will learn the practical aspects of setting up and remotely triggering LLMs from local machines, focusing on ease of use and efficiency. This talk is ideal for researchers and practitioners looking to leverage the power of LLMs in their work, offering a clear guide to harnessing supercomputing resources for quick and effective LLM inference.
We describe the deployment and use of Globus Compute for remote computation. This content is aimed at researchers who wish to compute on remote resources using a unified programming interface, as well as system administrators who will deploy and operate Globus Compute services on their research computing infrastructure.
May Marketo Masterclass, London MUG May 22 2024.pdfAdele Miller
Can't make Adobe Summit in Vegas? No sweat because the EMEA Marketo Engage Champions are coming to London to share their Summit sessions, insights and more!
This is a MUG with a twist you don't want to miss.
4. Introduction
› Software development without testing.
› Not every part of the program should be
tested.
› Testing leads to higher software quality.
5. Testing Levels/Types
1. Acceptance Tests
2. System Tests
3. Integration Tests
4. Unit Tests
Acceptance
System
Unit
Integration
High Level
Low Level
6. Evaluate the
system's
compliance with
the business
requirements
After the system
testing is over, the
software is tested
by the client/user.
Acceptance Testing
Testing an
integrated system
to verify that it
meets specified
requirements.
Done by software
testing team.
Used to verify the
functionality,
performance, and
reliability of the
modules that are
integrated.
Either performed by
developers or testing
team, this depends on
the integrated layer
under test
The main aim is to
isolate each unit of
the system to
identify, analyze
and fix the defects.
Only a developer
should do it.
System Testing Integration Testing Unit Testing
8. Unit Testing
› Aims to test the functionality of an isolated unit.
› Greatly helps in refactoring.
› Testing a function across two classes is
integration testing, not unit testing.
› Java has two major unit testing frameworks:
JUnit & TestNG.
› Code coverage: how many tests are executed
when running unit tests. Its frameworks are
JaCoCo, EclEMMA ( or EMMA)
9. Why Unit Testing?
› Quick changes to the
code.
› Documents code
design.
› Instant visual feedback
and diagnosis.
› Predict bugs and lower
development time.
› Verify code correctness.
10. Unit Testing Frameworks
JUnit
› Latest is JUnit5
› Most used test
framework, the official
Java test framework
TestNG
› Latest is TestNG 6
› Less used framework
but still favored by
many developers
1. TestNG had more features than JUnit4 but with JUnit 5 they
became almost equal to each other.
2. TestNG a little better reporting and support for parallelism
3. Maven supports using test units for both of them.
4. I will use JUnit in my example because it has more public
support but TestNG is an excellent framework nonetheless.
11. Simple JUnit Test Example
MyUnit.java
public class MyUnit {
public String
concatenate(String one,
String two){
return one + two;
}
}
MyTests.java
import org.junit.Test;
import static org.junit.Assert.*;
public class MyUnitTest {
@Test
public void testConcatenate() {
MyUnit myUnit = new MyUnit();
String result = myUnit.concatenate("one",
"two");
assertEquals("onetwo", result);
}
}
12. Basic JUnit Features & Annotations
@Test(expected, timeout): used to annotate a test.
@Before: annotates a function that runs before every test.
@BeforeClass: runs once before the whole class finishes execution.
@After: runs after every test.
@AfterClass: runs once after the whole class finishes execution.
@Ignore: a test function that is disabled.
Assert.*: multiple functions that are used to assert the correctness
of a test result (assertEquals, assertFalse, assertArraysEqual , ...etc.).
Test suite: it is a way to group test classes and run them together.
@Suite.SuiteClasses({tests .class array}): test classes of the suite.
@RunWith(Class<Runner>): marks the runner class which is a class
that implements Runner and used to run test classes with special
requirements( ex: PowerMockRunner.class & Suite.class )
14. Mocking
› As we need to isolate a unit for testing,
the need for mocking has arisen.
› Before mocking, people had to create
fake classes to simulate the dependency.
› It is creating dependencies that simulate
the behavior of real dependencies.
› It also can verify function call.
› Mostly used for unit tests layer.
15. How Mocking Works
A proxy is made using reflection for
interfaces and bytecode rewrites for
mocking concrete classes.
As for mocking a static class, the classloader
is modified in compile-time to use a special
proxy class instead of the original class.
16. Java Mocking Frameworks
1. Mockito: Simple & clean API.Easy to learn.
2. PowerMock: Used for special cases, solves
Mockito disadvantages.
3. JMockit: Can mock every dependency but has a
steep learning curve.
4. EasyMock: Has many flexible options for
mocking, but has a small community.
I will be using Mockito + PowerMock combination
in my example as that give allow powerful
mocking that’s easy to learn.
17. Mockito Annotations & Features
@Mock/mock(): tells Mockito to mock objects, every function
will return an object or null/primitive type if not specified
@InjectMock: tells Mockito to inject its mocks into an object.
Mockito.verify(someFunction(),times(#)): verifies number of
calls of a specific function.
Mockito.when(someFunction()).[thenReturn()|thenAnswer()|the
nThrow()|thenCallRealMethod()]: stubs an action when a
mocked function is used.
Mockito.[doNothing()|doReturn()|doThrow()|doAnswer()].when
(mockObject).someFunction(): mocks a void function behaviour.
@Spy/Mockito.spy(new someObject): allows partial mocking so
only mocked functions return results but non-mocked functions
will work normally.
@Captor/Mockito.ArgumentCaptor: a special class to capture
the argument passed to a function when verifying it.
18. Mockito Example
@RunWith(MockitoJUnitRunner.class)
public class ItemServiceTest {
@Mock private ItemRepository itemRepository;
@InjectMocks private ItemService itemService;
@Test
public void getItemNameUpperCase() {
Item mockedItem = new Item("it1", "Item 1", "This is item 1", 2000, true);
when(itemRepository.findById("it1")).thenReturn(mockedItem);
String result = itemService.getItemNameUpperCase("it1");
verify(itemRepository, times(1)).findById("it1");
assertThat(result, "ITEM 1");
}
}
19. PowerMock
› It solves Mockito shortcomings.
› Used to mock constructors, static, final
and private methods.
› Mostly delegates the actual mocking to
the underlying mocking framework as
Mockito or EasyMock.
20. PowerMockito
› PowerMockito class is the integration
between Mockito and PowerMock.
› PowerMockito has most of Mockito
methods like mock(),spy(),when(),
doNothing() or thenReturn().
› It also has some other methods such as
mockStatic(), verifyStatic()
21. Mockito + PowerMock Example
@RunWith(PowerMockRunner.class)
@PrepareForTest({StaticService.class})
public class ItemServiceTest {
@Mock
private ItemRepository itemRepository;
@InjectMocks
private ItemService itemService;
@Before
public void setUp() throws Exception {MockitoAnnotations.initMocks(this);}
@Test
public void readItemDescriptionWithoutIOException() throws IOException {
String fileName = "DummyName";
PowerMockito.mockStatic(StaticService.class);
when(StaticService.readFile(fileName)).thenReturn("Dummy");
String value = itemService.readItemDescription(fileName);
PowerMockito.verifyStatic(times(1));
StaticService.readFile(fileName);
assertThat(value, "Dummy");
}
}
23. Background
Test-Driven Development (TDD) originated
from eXtreme Programming (XP) paradigm
but continued into modern Agile paradigms.
A software development technique where
developers write a failing test that will
define the functionality before writing
actual code.
24. TDD Cycle and Rules
Red RefactorGreen
1. First, write an initially failing (RED) automated test case
that defines a new functionality.
2. Then produces the minimum amount of code to pass
(GREEN) test.
3. Finally refactors (REFACTOR) the new code to
acceptable standards.
4. Run tests again after refactoring if it fails re-do the cycle.
The cycles should be as short as possible.
25. TDD Flowchart
Add a test
Run The Test
Run the tests
Make a little change
[Pass]
[Fail]
[Fail]
[Pass]
Refactor
[Pass Refactoring]
[Development
Ends]
[Development
Continues]
26. › Ensures a clean working code that fulfills
requirements.
› Greatly decrease defects in the long run
with a slight increase in initial
development time.
› Increases productivity in the long run.
› Leads to high code coverage and more
unit tests as developers only write code
with preliminary tests.
Why TDD?
27.
28.
29. TDD Case Studies
Microsoft
40%-90%
pre-release defect
density decrease
with an increase of
15%-35% in initial
development.
IBM
40% fewer defects
with almost no
impact on team’s
productivity.
Ericsson
TDD increased
software quality
with an increase of
15% of initial
development.