It's about how to involve unit-testing into an existing application.
Unit-testing is never easy to be approached, there's some experience about how to begin within it.
This is an introduction to unit testing using various mocking frameworks. It covers why you should consider using a mocking framework, how to apply mocks in your unit testing, and a high level comparison of various tools for mocking/stub creation. The distinction between mocks and stubs is clearly defined.
Creating testing tools to support developmentChema del Barco
This is a presentation I made for the Kraków Java User Group on test automation and how to solve the challenges around it to make it really useful for development teams. It contains some examples of how we are doing it at Akamai's Web department, and some based on my own experience.
There are many types of automatic tests, testing tools, libraries and approaches.
Automatic tests can save you a lot of stress but can also became a kind of a nightmare.
This presentation is an overview of what's available and how to use and not to use them to make them really useful.
Examples taken from PHP world. You might be surprised how many tools is available.
Unit testing and test-driven development are practices that makes it easy and efficient to create well-structured and well-working code. However, many software projects didn't create unit tests from the beginning.
In this presentation I will show a test automation strategy that works well for legacy code, and how to implement such a strategy on a project. The strategy focuses on characterization tests and refactoring, and the slides contain a detailed example of how to carry through a major refactoring in many tiny steps
Unit Testing 101 presented at ESRI Developer Summit, March 24th, 2009. This talk reviews the key concepts of unit testing, the technologies used by DTSAgile in out development projects.
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 is an introduction to unit testing using various mocking frameworks. It covers why you should consider using a mocking framework, how to apply mocks in your unit testing, and a high level comparison of various tools for mocking/stub creation. The distinction between mocks and stubs is clearly defined.
Creating testing tools to support developmentChema del Barco
This is a presentation I made for the Kraków Java User Group on test automation and how to solve the challenges around it to make it really useful for development teams. It contains some examples of how we are doing it at Akamai's Web department, and some based on my own experience.
There are many types of automatic tests, testing tools, libraries and approaches.
Automatic tests can save you a lot of stress but can also became a kind of a nightmare.
This presentation is an overview of what's available and how to use and not to use them to make them really useful.
Examples taken from PHP world. You might be surprised how many tools is available.
Unit testing and test-driven development are practices that makes it easy and efficient to create well-structured and well-working code. However, many software projects didn't create unit tests from the beginning.
In this presentation I will show a test automation strategy that works well for legacy code, and how to implement such a strategy on a project. The strategy focuses on characterization tests and refactoring, and the slides contain a detailed example of how to carry through a major refactoring in many tiny steps
Unit Testing 101 presented at ESRI Developer Summit, March 24th, 2009. This talk reviews the key concepts of unit testing, the technologies used by DTSAgile in out development projects.
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
Test Driven Development - Phương pháp phát triển phần mềm theo hướng viết test trước.
Áp dụng TDD sẽ đem lại cho bạn thiết kế phần mềm trong sáng hơn và quản lý được chất lượng từng dòng code của mình viết ra.
Bài trình bày của bạn Lê Anh tại Meetup của Ha Noi .NET Group.
Chi tiết vui lòng xem tại: http://tungnt.net
Exception handling is always an important topic. This presentation will provide couple of good practices to deal with Errors & Exceptions happing in Node.js.
Keep those in mind, you will write a better code for a more stable software.
Happy Coding!
In this experiential webinar, our guest Mohamed Shaaban will share with you his wide experience in Unit Testing in addition to practical techniques for unit testing your code using C#, NUnit, and Moq.
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
Lightening Talk I gave at Inaka in May 2014.
This is sort of the continuation of my previous iOS TDD talk.
Since TDD and DI go quite hand in hand and they are both extend concepts to learn in one shot, I had to prepare a completely separated talk for spreading to my fellows the DI knowledge I had acquired.
Writing useful automated tests for the single page applications you buildAndrei Sebastian Cîmpean
How to approach testing if you are building a modern single page application. I try to emphasize that integration testing is the way to go and that developers should consider the tests as part of the system and spend time to maintain them.
Lightening Talk I gave at Inaka in April 2014.
I was in charge of investigating test-driven development for our iOS mobile team. Since I realized it was such a big concept, after having gathered enough information and having played with it enough, I decided to introduce my fellows on the topic by presenting it in a formal talk with slides. The aim was teaching them a different way of developing, which, for us, at that moment, was completely new and controversial.
Book review: Working Effectively with Legacy Code, by Michael C. Feathers
Agenda
- The mechanics of change
- Changing software
- Dependency breaking techniques
This session is for developers who need to work on code projects that where written without good unit-testing.
Test Driven Development - Phương pháp phát triển phần mềm theo hướng viết test trước.
Áp dụng TDD sẽ đem lại cho bạn thiết kế phần mềm trong sáng hơn và quản lý được chất lượng từng dòng code của mình viết ra.
Bài trình bày của bạn Lê Anh tại Meetup của Ha Noi .NET Group.
Chi tiết vui lòng xem tại: http://tungnt.net
Exception handling is always an important topic. This presentation will provide couple of good practices to deal with Errors & Exceptions happing in Node.js.
Keep those in mind, you will write a better code for a more stable software.
Happy Coding!
In this experiential webinar, our guest Mohamed Shaaban will share with you his wide experience in Unit Testing in addition to practical techniques for unit testing your code using C#, NUnit, and Moq.
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
Lightening Talk I gave at Inaka in May 2014.
This is sort of the continuation of my previous iOS TDD talk.
Since TDD and DI go quite hand in hand and they are both extend concepts to learn in one shot, I had to prepare a completely separated talk for spreading to my fellows the DI knowledge I had acquired.
Writing useful automated tests for the single page applications you buildAndrei Sebastian Cîmpean
How to approach testing if you are building a modern single page application. I try to emphasize that integration testing is the way to go and that developers should consider the tests as part of the system and spend time to maintain them.
Lightening Talk I gave at Inaka in April 2014.
I was in charge of investigating test-driven development for our iOS mobile team. Since I realized it was such a big concept, after having gathered enough information and having played with it enough, I decided to introduce my fellows on the topic by presenting it in a formal talk with slides. The aim was teaching them a different way of developing, which, for us, at that moment, was completely new and controversial.
Book review: Working Effectively with Legacy Code, by Michael C. Feathers
Agenda
- The mechanics of change
- Changing software
- Dependency breaking techniques
This session is for developers who need to work on code projects that where written without good unit-testing.
Review on cost estimation technque for web application [part 1]Sayed Mohsin Reza
Prepared by Sayed Mohsin Reza
Part 1
Source Book: Cost Estimation Techniques for Web Projects
BOOK AUTHOR: EMILIA MENDES UNIVERSITY OF AUCKLAND, NEW ZEALAND
Difference about Web and Software Projects
Introduction to Web Cost Estimation
Accuracy of an Effort Model?
Sizing Web Applications
Debora d'Avila Reis Universidade das Criançaseucunet
Presentation from the SiS Catalyst and EUCU.NET Technucation conferernce at the University of Porto, 28th November to 1st December 2013. Workshop A - The Content.
Estimation - web software development estimation DrupalCon and DrupalCamp pre...Andy Kucharski
Project Estimation Presentation at DrupalCamps. Presentation discussing risks, methods and recommendations when estimating software estimation with a focus on web CMS (drupal)
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.
This workshop is about testing the right way. Get a clear view on how to test your code in an efficient and useful way!
This first testing-related workshop is about all aspects of unit testing. Integration testing and TDD will have their own dedicated workshops.
Unit tests give developers and testers a quick way to look for logic errors in the methods of classes in Visual C#, Visual Basic, and Visual C++ projects. A unit test can be created one time and run every time that source code is changed to make sure that no bugs are introduced.
Stopping the Rot - Putting Legacy C++ Under TestSeb Rose
Presentation given at the ACCU 2011 Conference in Oxford, UK.
Case study of applying unit test to the DOORS codebase. Includes a quick overview of unit test & the Google Test and Mock libraries. Also 3 specific refactoring examples shown.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
Generating a custom Ruby SDK for your web service or Rails API using Smithyg2nightmarescribd
Have you ever wanted a Ruby client API to communicate with your web service? Smithy is a protocol-agnostic language for defining services and SDKs. Smithy Ruby is an implementation of Smithy that generates a Ruby SDK using a Smithy model. In this talk, we will explore Smithy and Smithy Ruby to learn how to generate custom feature-rich SDKs that can communicate with any web service, such as a Rails JSON API.
4. Concept
●Why unit test?
oPrevent side-effect as less as possible.
oImprove code quality and stability.
oImprove maintainability.
oConsolidate design.
oSave time from manual testing in the future.
oDescribe the usage of your libraries and classes.
5. Concept
●How unit test help our code quality?
When you are doing implementation…
oHow do you confirm your design “loosely-coupled” well
enough?
oHow do you keep the correct behavior of the class you’re
updating?
oHow do you ensure you have fixed the bug?
oHow do you describe some tricky design / use case?
●Key rule: Cut off all dependency!!!
1.Human interaction dependency(UI)
2.Library dependency
3.Sequence dependency
4.Environment dependency
5.Hierarchy dependency
6. Concept
●Cost - You must pay, then gain…
oWrite code to verify code: More code, more bug.
oCost much more time than real functional implementation.
oMuch more code have to be maintained.
Exchange short-term effort for long-term benefit.
7. Concept
●Mind construction:
oDo not think coverage, JUST DO IT®.
oTest case shall keep growing, never think approach all at one
time.
oIt saves the future, not save the present.
oDoing unit test is never easy, so it make quality competitive.
There’s no silver bullet.
10. Implementation
Best practice policy:
1.Every public entry must have at least 1 unit test case.
2.Pair programming technique –
One implement test case, the other one implement functionality.
3.TDD (Not DDT) –
Test-Driven Development –
Implement test case before implement functional code.
12. Implementation
Unit test running life-cycle for a class:
ClassInitialize
TestInitialize
TestMethod
TestCleanup
ClassCleanup
TestInitialize
TestMethod
TestCleanup
13. Implementation
How to do a useful test case:
●Awful, but at least it prevents run-time exception in some case.
●Better one:
14. Implementation
How to do a useful test case:
●Is this one good idea?
Better to avoid this style, keep the meaning of “unit” in mind.
15. Implementation
How to do a useful test case:
The other bad sample…
Some genius developer write a perfect bug-free implementation, how come it failed to pass test
case:
??
16. Implementation
How to do a useful test case:
The other bad sample…
Updating test case assume there’s an existing member…
After running the creating test case, the updating test case passed.
There’s a test case sequential dependency.
Once a test case can’t be executed alone,
it’s NOT an unit test case.
17. Implementation
How to do a useful test case:
How to make the case better…
Preparing its own precondition is every unit test case’s “Ownership”!
18. Implementation
How to do a useful test case:
How to test error handling…
FunSpec: Once user try to create duplicated member, we shall throw exception to alert user.
19. Implementation
How to do a useful test case:
How to follow up?
1.Don’t do new unit-test case by only coverage reason.
2.Build new test case by JIRA Ticket.
20. Implementation
Ticket unit test life-cycle:
Got ticket
Write test code
to reproduce
the case
Test Failure.
Fix the bug.
Pass test case
Commit
QA verify
26. Challenge
How to cut-off dependency?
Use MVC design to separate logic and UI
private void OnButtonClick(EventArg e) {
if (txtBox1.Text == “ABC”) {
txtAnswer.Text = “XXX”;
} else if (txtBox1.Text == “DEF”) {
txtAnswer.Text = “YYY”;
}
}
Change code design like this:
private void OnButtonClick(EventArg e) {
txtAnswer.Text = new Controller().GetAnswer(txtText1.Text);
}
// controller class can be unit tested.
public class Controller {
public string GetAnswer(string input) {
if (input == “ABC”) {
return “XXX”;
} else if (input == “DEF”) {
return “YYY”;
}
}
}
27. Challenge
How to cut-off dependency?
Library dependency:
You want to test “ClassA”, but “ClassA” associated with “ClassB”, and
you don’t want to involve “ClassB” in this test case.
public class MathTool
{
public int AddNumber(int a, int b)
{
BackendService service = new BackendService(); // Dependency happen here.
return service.AddNumberWebservice(a, b);
}
}
public class BackendService {
public int AddNumberWebservice(int a, int b) {
HttpClient client = new HttpClient();
client.Url = "http://LiveMathTeacher.spi/AddNumber.asmx";
client.SubmitData(a, b);
int c = (int)client.GetResponseData();
return c;
}
}
28. Challenge
public class BackendService : IService {
public int AddNumberWebservice(int a, int b) {
HttpClient client = new HttpClient();
client.Url = "http://LiveMathTeacher.spi/AddNumber.asmx";
client.SubmitData(a, b);
int c = (int)client.GetResponseData();
return c;
}
}
public class MockService : IService {
public int AddNumberWebservice(int a, int b) {
return a + b;
}
}
29. Challenge
How to cut-off dependency?
Environment Dependency:
●If your class must access environment resource, like container(IIS)…
public string GetLoginUserName() {
if (CheckToken((string)Request[“token”])) // It accesses HTTP request resource
return (string)Session[“UserName”]; // It accesses IIS memory
}
Encapsulate those resource into tool classes:
public class SessionManager {
#if(UNIT_TEST)
// Use Dictionary structure to replace Session in unit-test
public static Dictionary<string, object> Session = new Dictionary<string, object>();
#else
public static HttpSessionState Session = HttpContext.Current.Session;
#endif
}
Use similar class for switching:
public string GetLoginUserName() {
if (CheckToken((string)RequestManager.Request[“token”]))
return (string)SessionManager.Session[“UserName”];
}
30. Challenge
How to cut-off dependency?
Hierarchy Dependency:
●If your class inherits from the other class which you don’t have source(3rd
party library…etc) and the base class would access any other dependency
that you can’t cut-off…
Examples:
// This class inherits from System.ServiceProcess.ServiceBase, its constructor will auto access environment resource.
using System.ServiceProcess;
public class MyService : ServiceBase { }
// This class inherits from System.Web.UI.Page, it’s ASP.NET class and access IIS resource.
using System.Web.UI;
public class MyPage : Page { }
37. Professional guideline
Extract the summary from the book “Pragmatic Unit Test”:
General Principles:
1.Test anything that might break
2.Test everything that does break
3.New code is guilty until proven innocent
4.Write at least as much test code as
production code
5.Run local tests with each compile
6.Run all tests before check-in to repository
Questions to Ask:
1.If the code ran correctly, how would I know?
2.How am I going to test this?
3.What else can go wrong?
4.Could this same kind of problem happen
anywhere else?
38. Professional guide line
Extract the summary from the book “Pragmatic Unit Test”:
What to Test: Use Your RIGHT-BICEP
1.Are the results right?
2.Are all the boundary conditions CORRECT?
3.Can you check inverse relationships?
4.Can you cross-check results using other
means?
5.Can you force error conditions to happen?
6.Are performance characteristics within
bounds?
Good tests are A TRIP
1.Automatic
2.Thorough
3.Repeatable
4.Independent
5.Professional
39. Professional guide line
Extract the summary from the book “Pragmatic Unit Test”:
CORRECT Boundary Conditions
1.Conformance - Does the value conform to an
expected format?
2.Ordering - Is the set of values ordered or
unordered as appropriate?
3.Range - Is the value within reasonable
minimum and maximum values?
4.Reference - Does the code reference
anything external that isn‘t under direct control
of the code itself?
5.Existence - Does the value exist? (e.g., is
non-null, non-zero, present in a set, etc.)
6.Cardinality - Are there exactly enough
values?
7.Time (absolute and relative) - Is everything
happening in order? At the right time? In
time?
In object-orient design, ideally we purchase “loosely-coupled” design. How do you confirm your design “loosely-coupled” well enough? By unit test.
If it’s hard to implement unit test on your class, it indicate your class design is not “loosely-coupled”.
In object-orient design, ideally we purchase “loosely-coupled” design. How do you confirm your design “loosely-coupled” well enough?By unit test. If it’s hard to implement unit test on your class, it indicate your class design is not “loosely-coupled”.Due to unit test can’t test GUI or any human manually operation, this limit force you do MVC( Model / View / Control ) design!
Prevent QA reopen regression bug.
Every ticket should have a test case to reproduce it, then try to pass it.
Every test case show how to use this class or method by outside respect.
Dependency:
Human interaction dependency(UI) – By MVC design
Library dependency
Sequence dependency
Environment dependency
Hierarchy dependency
After you know the cost and price to involve one methodology, you must have some mind preparation.
Everything has a balance decision, we shall figure out what the balance is, this is trade-off.
“If you always think a cheaper way, easy way to do anything, then you shall get cheaper salary and easy pay by that.”
“Keep your doing and thinking in valuable way, then you will get valuable salary.”
See the video demo.
DDT can kill bugs, I think TDD can do it also.
ClassInitialize: Initial some important precondition to make all test cases runnable by class level: Like some static resource initialization, database connection establish…etc.
TestInitialize: Restore testing data / materials, precondition as well.
TestMethod: Your test case
TestCleanup: Clean up any result generated by the test case.
ClassCleanup: Release some static resource, clean up legacy data as well.
We assume SQLHelper has been initialized in “ClassInitialize”.
All legacy data has been clean up in “TestInitialize”
It actually mixes 2 method test into 1, and it made the test case has dependency to the other method which is not our primary test target.
Once this case is failure, not easy to clarify
Why???
What’s ownership? It’s ownership.
What’s ownership? It’s ownership.
After we bulild up general test case, how to follow up?