The essentials of Cucumber-JVM and Spock - a handbook written for the BDD/TDD Masterclass (https://johnfergusonsmart.com/programs-courses/bdd-tdd-clean-coding/)
A presentation of what are JavaScript Promises, what problems they solve and how to use them. Dissects some Bluebird features, the most complete Promise library available for NodeJS and browser.
A presentation of what are JavaScript Promises, what problems they solve and how to use them. Dissects some Bluebird features, the most complete Promise library available for NodeJS and browser.
This year ECMA International will be ratifying the biggest update to the JavaScript language in its history. In this talk we'll look at key features already appearing in browsers as well as those coming in the near future. We'll also explore how you can begin leveraging the power of ES6 across all browsers today. If you haven't looked at JavaScript recently, you soon realize that a bigger, better world awaits.
Slides from the NestJS MasterClass.
We learned how to build JavaScript server-side applications with NestJS - A progressive NodeJS framework built with TypeScript.
You can find the code on GitHub:
https://github.com/nirkaufman/task-manager
NestJS (https://nestjs.com/) is a Node.js framework for building server-side applications. This slide give you a brief introduction of Nest, and shows the examples like Service, Middleware, and Pipe, etc.
I talked about Vue.js at @agenciasomadev. In this talk I showed the basics about the Vue.js JavaScript Framework and it's simplicity. I hope you enjoy :)
This talk introduces Spring's REST stack - Spring MVC, Spring HATEOAS, Spring Data REST, Spring Security OAuth and Spring Social - while refining an API to move higher up the Richardson maturity model
Sequelize is a promise-based Node.js ORM for Postgres, MySQL, MariaDB, SQLite and Microsoft SQL Server. It features solid transaction support, relations, eager and lazy loading, read replication and more.
Presentation on MongoDB and Node.JS. We describe how to do basic CRUD operations (insert, remove, update, find) how to aggregate using node.js. We also discuss a bit of Meteor, MEAN Stack and other ODMs and projects on Javascript and MongoDB
마이크로서비스 스타일로 만들어진 시스템을 모노리틱 스타일로 이관한 사례와 함께 스프링을 이용해 모듈형 모노리스(modular monoliths)를 만든 경험을 바탕으로 모노리틱/마이크로서비스 보다 본질적인 문제를 제기하고, 문제 해결을 위한 아이디어와 코드를 공유합니다.
https://github.com/arawn/building-modular-monoliths-using-spring
이 자료는 2019년 KSUG 세미나에서 진행한 "잘 키운 모노리스 하나 열 마이크로서비스 안 부럽다"를 기반으로 몇가지 내용을 추가하고, 전개 방식을 다듬어 조금 더 친절하게 만들어졌습니다.
Modelling by Example is a set of practices that combine BDD (Behaviour Driven Development) and DDD (Domain Driven Design) techniques to create a workflow that directly drives code from a starting point of user requirements. We will see how a simple feature can be defined via conversation with stakeholders, captured as automatable requirements, and expressed directly in the object model using tools such as Behat and PhpSpec.
Modelling by Example is a set of practices that combine BDD (Behaviour Driven Development) and DDD (Domain Driven Design) techniques to create a workflow that directly drives code from a starting point of user requirements. We will see how a simple feature can be defined via conversation with stakeholders, captured as automatable requirements, and expressed directly in the object model using tools such as Behat and PhpSpec.
This year ECMA International will be ratifying the biggest update to the JavaScript language in its history. In this talk we'll look at key features already appearing in browsers as well as those coming in the near future. We'll also explore how you can begin leveraging the power of ES6 across all browsers today. If you haven't looked at JavaScript recently, you soon realize that a bigger, better world awaits.
Slides from the NestJS MasterClass.
We learned how to build JavaScript server-side applications with NestJS - A progressive NodeJS framework built with TypeScript.
You can find the code on GitHub:
https://github.com/nirkaufman/task-manager
NestJS (https://nestjs.com/) is a Node.js framework for building server-side applications. This slide give you a brief introduction of Nest, and shows the examples like Service, Middleware, and Pipe, etc.
I talked about Vue.js at @agenciasomadev. In this talk I showed the basics about the Vue.js JavaScript Framework and it's simplicity. I hope you enjoy :)
This talk introduces Spring's REST stack - Spring MVC, Spring HATEOAS, Spring Data REST, Spring Security OAuth and Spring Social - while refining an API to move higher up the Richardson maturity model
Sequelize is a promise-based Node.js ORM for Postgres, MySQL, MariaDB, SQLite and Microsoft SQL Server. It features solid transaction support, relations, eager and lazy loading, read replication and more.
Presentation on MongoDB and Node.JS. We describe how to do basic CRUD operations (insert, remove, update, find) how to aggregate using node.js. We also discuss a bit of Meteor, MEAN Stack and other ODMs and projects on Javascript and MongoDB
마이크로서비스 스타일로 만들어진 시스템을 모노리틱 스타일로 이관한 사례와 함께 스프링을 이용해 모듈형 모노리스(modular monoliths)를 만든 경험을 바탕으로 모노리틱/마이크로서비스 보다 본질적인 문제를 제기하고, 문제 해결을 위한 아이디어와 코드를 공유합니다.
https://github.com/arawn/building-modular-monoliths-using-spring
이 자료는 2019년 KSUG 세미나에서 진행한 "잘 키운 모노리스 하나 열 마이크로서비스 안 부럽다"를 기반으로 몇가지 내용을 추가하고, 전개 방식을 다듬어 조금 더 친절하게 만들어졌습니다.
Modelling by Example is a set of practices that combine BDD (Behaviour Driven Development) and DDD (Domain Driven Design) techniques to create a workflow that directly drives code from a starting point of user requirements. We will see how a simple feature can be defined via conversation with stakeholders, captured as automatable requirements, and expressed directly in the object model using tools such as Behat and PhpSpec.
Modelling by Example is a set of practices that combine BDD (Behaviour Driven Development) and DDD (Domain Driven Design) techniques to create a workflow that directly drives code from a starting point of user requirements. We will see how a simple feature can be defined via conversation with stakeholders, captured as automatable requirements, and expressed directly in the object model using tools such as Behat and PhpSpec.
Modelling by Example is a set of practices that combine BDD (Behaviour Driven Development) and DDD (Domain Driven Design) techniques to creat a workflow that directly drives code from a starting point of user requirements. We will see how a simple feature can be defined via conversation with stakeholders, captured as automatable requirements, and expressed directly in the object model using tools such as Behat and PhpSpec
Driving Design through Examples - PhpCon PL 2015CiaranMcNulty
Modelling by Example is a set of practices that combine BDD (Behaviour Driven Development) and DDD (Domain Driven Design) techniques to creat a workflow that directly drives code from a starting point of user requirements. We will see how a simple feature can be defined via conversation with stakeholders, captured as automatable requirements, and expressed directly in the object model using tools such as Behat and PhpSpec.
Writing good acceptance criteria is one of the keys to effective software delivery. But it’s hard. In this workshop, you will learn about Feature Mapping, a new technique and easy that can help teams write higher quality acceptance criteria more easily. Feature Mapping is an excellent way to build a deep shared understanding of a story's requirements and clear a path to a smooth implementation of automated acceptance tests.
Patterns and practices for real-world event-driven microservices by Rachel Re...Codemotion Dubai
At Jet.com, we've based our architecture around cloud-based event-driven microservices, and over the last several months, have schooled ourselves on what works and what doesn't. This session will walk you through the lessons we have learned on our way to developing our platform.
Patterns and practices for real-world event-driven microservicesRachel Reese
Jet.com is an e-commerce startup competing with Amazon. We're heavy users of F#, and have based our architecture around Azure-based event-driven functional microservices. Over the last several months, we've schooled ourselves on what works and what doesn't for F# and microservices. This session will walk you through the lessons we have learned on our way to developing our platform.
Deep Dive Into Swift - Presented at Coffee@DBG
In the previous month, Coffe@DBG Covered the basics of Swift, Apple's new programming language. This session introduces some of handpicked interesting features of Swift.
Data dictionary, domain modelling and making things easyLockheed-Martin
Ole Nymoen of Norwegian airport operator looks at how a common data language can provide a framework for easier airport-to-airport integration. Ole is the technical architect for Avinor's multi-airport operational database project, centralising all operational platforms for 46 airports in to a single instance.
A C++ program //include headers; these are modules that include functions that you may use in your //program; we will almost always need to include the header that // defines cin and cout; the header is called iostream.h #include <iostream.h>
int main() {
//variable declaration //read values input from user //computation and print output to user return 0; }
After you write a C++ program you compile it; that is, you run a program called compiler that checks whether the program follows the C++ syntax – if it finds errors, it lists them – If there are no errors, it translates the C++ program into a program in machine language which you can execute.
Pricing Analytics: Segmenting Customers To Maximize RevenueMichael Lamont
Potential customers for a product or service can be segmented into valuation groups. High valuation groups are willing to pay more for the product or service, while low valuation groups are only willing to pay a lesser amount for the same product or service. This presentation provides a basic background on yield management through customer segmentation, and a hands-on example of modeling airline customer segmentation using Excel.
Code is not text! How graph technologies can help us to understand our code b...Andreas Dewes
Today, we almost exclusively think of code in software projects as a collection of text files. The tools that we use (version control systems, IDEs, code analyzers) also use text as the primary storage format for code. In fact, the belief that “code is text” is so deeply ingrained in our heads that we never question its validity or even become aware of the fact that there are other ways to look at code.
In my talk I will explain why treating code as text is a very bad idea which actively holds back our understanding and creates a range of problems in large software projects. I will then show how we can overcome (some of) these problems by treating and storing code as data, and more specifically as a graph. I will show specific examples of how we can use this approach to improve our understanding of large code bases, increase code quality and automate certain aspects of software development.
Finally, I will outline my personal vision of the future of programming, which is a future where we no longer primarily interact with code bases using simple text editors. I will also give some ideas on how we might get to that future.
Even in an agile world, specifications often go too far and describe solutions with too much details; all these premature decisions constraint the implementation and remove opportunities. There is a remedy: refactoring the specs, even before refactoring the code.
In the TDD cycle, refactoring is the art of restructuring the code to make it simpler, without changing its behavior at runtime. A key part of refactoring is to recognize and extract duplications.
Refactoring is very useful at the code level, and it is even more powerful when applied during business analysis or functional architecture. We will show how the practice of refactoring directly "at the business domain level" can simplify the problem, and therefore the resulting implementation code, by orders of magnitude. This means much less code to write, to test and to maintain, and much less defects as a result.
We will introduce 5 patterns on how to refactor at the business-domain level, such as "Make It Systematic" and "Degenerate Case". We will also explain some limits and the required mindset.
This approach of refactoring has been used on several real-world projects and is derived in particular from DDD and from Specification by Example.
Apidays Paris 2023 - Forget TypeScript, Choose Rust to build Robust, Fast and...apidays
Apidays Paris 2023 - Software and APIs for Smart, Sustainable and Sovereign Societies
December 6, 7 & 8, 2023
Forget TypeScript, Choose Rust to build Robust, Fast and Cheap APIs
Zacaria Chtatar, Backend Software Engineer at HaveSomeCode
------
Check out our conferences at https://www.apidays.global/
Do you want to sponsor or talk at one of our conferences?
https://apidays.typeform.com/to/ILJeAaV8
Learn more on APIscene, the global media made by the community for the community:
https://www.apiscene.io
Explore the API ecosystem with the API Landscape:
https://apilandscape.apiscene.io/
This prototype works, but it's not pretty, and now it's in production. That legacy application really needs some TLC. Where do we start? When creating long lived applications, it's imperative to focus on good practices. The solution is to improve the whole development life cycle; from planning, better coding and testing, to automation, peer review and more. In this talk, we'll take a quick look into each of these areas, looking at how we can make positive, actionable change in our workflow.
Week 1 AssignmentCIS290v61University of Phoenix Materia.docxcelenarouzie
Week 1 Assignment
CIS/290v6
1
University of Phoenix MaterialPart 1: Computer Research
Moore’s Law states that the number of transistors on a computer chip doubles every two years. This means that the power, speed, and application of computers are ever increasing. Along with these changes in performance, software is also improving and constantly pushing a computer’s capabilities to the edge.
As a computer technician, you must constantly stay up-to-date with these changes in technology. This includes understanding the dynamics of hardware and software and how they interact with each other. To stay current, you must include research as a necessary part of your job. With rapid changes going on in the computer industry, a technician needs to build a trusted network of information resources that includes websites, periodicals, and industry professionals.
Computer benchmark tests and tools are other resources you can turn to for computer information. In a benchmark test, the performance of a software application is measured when one brand of a hardware component is placed inside a computer. By using the same application and computer for each test, different brands of a component can then be compared with one another, allowing you to choose the best brand for the job at the price you want to pay. Benchmarks are a good way to get you started with your research. You will be using them throughout this course.
To help you get started, here are some helpful websites:
· www.pricewatch.com: This is a helpful site to check pricing; however, be sure to look at the condition of the product. It can be listed as new or refurbished.
· www.tomshardware.com and www.kingston.com: These are benchmark sites to check out product performance.
· www.pcworld.com: This is a popular site for information and product reviews.
· www.ifixit.com and www.macfixit.com: These are helpful sites for troubleshooting.
Keep in mind that these are just a few of the many sites available for computer technicians. As you continue gaining experience, you develop your own network of trusted information resources.
Activity: Information Research
Begin your research by searching the Internet for additional websites, not mentioned previously, which offer pricing, technical reviews, and troubleshooting for computers and computer components. Enter these websites into the charts below and provide a succinct description of the website.
Price Check Sites
Identify three price check sites and provide a description summary of what the site provides.
Website URL
Summary Description
Product Review Sites
Identify three product review sites and provide a description summary of what the site provides.
Website URL
Summary Description
Troubleshooting Sites
Identify three troubleshooting sites and provide a description summary of what the site provides.
Website URL
Summary Description
Part 2: Comparing Computers Worksheet
Computers range in price and options the same way as many ot.
Written specs are easy to read but hard to write. Even with an understanding of the principles and tips for writing good Gherkin, it can be very hard to keep scenarios clean, informative and readable.
These slides are from a workshop given by John Ferguson Smart and Tom Roden, where they take a practical look at some real-world Gherkin scenarios, investigate what makes them smell and practise how to improve them. Discover some powerful refactoring patterns to help make your own specs a joy to read.
It was the time of Da Vinci and Michelangelo. It was also the time of Machiavelli and the Medici. Artists working on timeless masterpieces crossed paths with mercenary captains, contracted to do a very specific job.
In this keynote talk, John Smart will address important questions with deep implications for any IT team, or any organisation trying to make a difference, or simply to get the most value out of their IT projects.
Who is your real customer? Is there a cost to quality? Are you building an artwork that will last, or simply fulfilling a contract?
An inspiring and entertaining talk that will take attendees on journey from the Italian Renaissance to Silicon Valley and the City of London, and see what lessons can be learned about cultures, attitudes and work ethics today.
Discover how you can multiply your team’s productivity and innovation by engaging the creativity of your whole team from the outset. Drawing from his long experience helping teams deliver better software faster and more effectively, John will discuss the latest practical techniques leveraged from Behaviour Driven Development, Lean Enterprise, DevOps, and Test Automation, combined with research in Psychology and Team Performance, to show you how to get the best out of your teams.
Learn about the new roles of business analysts, developers and testers in the future of software development, where testers can play a vital role in not only detecting defects but preventing them. Discover how you can make test automation happen during, not after, the sprint, and how to engage the creativity of the whole team right from the word "go".
his talk will present the core concepts of Exponential Business Agility, or XBA. XBA is a set of patterns for organising value streams around self-organising, autonomous teams, and is part of the XSCALE approach to scaling agile. XBA combines the Spotify model with practice patterns drawn from the Iroquois Confederacy, the most successful and longest-lived holarchy in history.
Learn how Throughput Accounting optimises the contribution of each business function to top line throughput rather than blindly attempting to minimise operating expense.
And discover how Self-Propagating Transformation avoids pushing change into pre-existing teams, programs or silos, but generates agile capability by grafting the kernel of a new culture onto the trunk of the old.
Be a pod of dolphins, not a dancing elephant. Don’t try to scale agile. De-scale your organisation instead.
As projects get faster and teams get leaner, the need to write high quality automated acceptance criteria quickly and efficiently has never been greater. Engineers in Test simply cannot afford to spend time maintaining brittle tests. And yet, without solid test automation strategies, this is what many teams find themselves doing. In this workshop, you will learn a better way. You will learn how to write clean, clear and maintainable tests using the Screenplay Pattern, an innovative new approach to writing BDD-style automated acceptance tests that are easier to understand, easier to extend and easier to maintain. The workshop will be a practical demonstration of the principles of good automated test design. There will be live coding of real-world BDD automated acceptance tests in abundance, using Java, Serenity BDD and Cucumber. We will go from requirements and BDD-style Acceptance Criteria in Cucumber right through to automated acceptance tests and living documentation.
International speaker and author of “BDD in Action” John Ferguson Smart shows how you can multiply your team’s productivity and innovation by engaging the creativity of your whole team from the outset. Drawing from his long experience helping teams deliver better software faster and more effectively, John will discuss the latest practical techniques leveraged from Behaviour Driven Development, Lean Enterprise, DevOps, and Test Automation, combined with research in Psychology and Team Performance, to show you how to get the best out of your teams. Learn about the new roles of business analysts, developers and testers in a DevOps world, and how testers can play a vital role in not only detecting defects but preventing them. Discover how you can make test automation happen during, not after, the sprint, and how to engage the creativity of the whole team right from the word "go".
IT teams today are under constant pressure to deliver more value sooner, and Behaviour Driven Development (BDD) is one of the more effective ways to help teams deliver the high quality software that their business needs. When they adopt BDD, many teams look to tools like Cucumber to help them. But BDD isn’t simply about picking up a new tool.
In fact, there is a lot more to BDD than Given/When/Then and tools like Cucumber, and both can be misused. In this talk, we will take a step back and look at the bigger picture, and learn why using Gherkin at the wrong time, or for the wrong purpose, may be holding you back.
IT teams today are under constant pressure to deliver more value sooner, and Behaviour Driven Development (BDD) is one of the more effective ways to help teams deliver the high quality software that their business needs. When they adopt BDD, many teams look to tools like Cucumber to help them. But BDD isn’t simply about picking up a new tool.
In fact, there is a lot more to BDD than Given/When/Then and tools like Cucumber, and both can be misused. In this talk, we will take a step back and look at the bigger picture, and learn why using Gherkin at the wrong time, or for the wrong purpose, may be holding you back.
The changing role of testing and test automation in the increasingly fast-paced world of continuous delivery and automated acceptance testing. Learn how, in a DevOps environment, testing activities start with requirements discovery and definition, playing a vital role in not only detecting defects, but preventing them, and ensuring not only that the features are built right, but the right features are built. And learn how test automation needs to happen during, not after, the sprint, and how you can achieve this.
Despite rumors to the contrary, the role of the tester is not diminished with the arrival of automated DevOps, with its ultra-rapid deployment cycles and its emphasis on automation. On the contrary, testers play a vital role in ensuring that the code that gets deployed ten times a day is worth deploying.
Learn how to write robust and articulate tests using the Screenplay Pattern, an innovative approach to writing BDD-style automated acceptance tests that are easier to understand, easier to extend and easier to maintain.
Every test tells a story, but some tell a better story than others. Every test illustrates a specific path through the system to achieve a specific goal, but some paths are clearer than others. Valuable tests are the ones that both tell a compelling story, and can stand the test of time, providing value not only as acceptance tests but also as living documentation and easily maintainable regression tests.
In this session, John will invite you to come on a journey of discovery to learn how to write clean, clear and maintainable tests using the Journey Pattern, an innovative new approach to writing automated acceptance tests that are easier to understand, easier to extend and easier to maintain. You will also witness a demonstration of these principles in action, with live coding of Serenity BDD automated tests.
Learn how to plan, prioritise and deliver higher value features by thinking of deliverable features not in terms of what they cost, but of what they can deliver.
XScale is a set of practices based on BDD that enables a product team to efficiently define, budget and prioritise a roadmap or backlog.
It’s also a way to answer some questions Agile has traditionally avoided:
- How much will a set of features cost?
- How do we trade off different feature sets?
- How do we know a feature is ready to ship?
In this workshop, we outline several key practices and practice using a few of them. The main practices we cover include:
- Feature Points, a way to reconcile budgets with story points
- Backlog Bingo determines the dollar investment and relative return for a set of products and services
- Royal Cod applies Backlog Bingo to prioritize a Breadth-First Roadmap
- Release Refactoring enables product owners to make rational trade-offs between feature-sets.
Behaviour Driven Development is a powerful collaboration technique that can empower teams to deliver higher value features to the business faster and more effectively. But although Behaviour Driven Development is based on a number of simple principles, it can go dramatically wrong in a myriad of different ways.
In this talk we discuss twelve BDD anti-patterns we frequently encounter in real-world BDD projects, anti-patterns that can dramatically reduce the effectiveness of BDD as a practice, and that can even cause BDD adoption to fail entirely. Looking at everything from insufficient collaboration practices to poor use of test automation tooling, from teams that test too much to teams that forget the most important scenarios, we will look at the many different ways that BDD can go wrong, and how it should be done.
We will use real-world examples to illustrate each of these anti-patterns. You will learn how to spot these issues in your own projects, and more importantly how to avoid them in the first place.
Every test tells a story, but some tell a better story than others. Every test illustrates a specific path through the system to achieve a specific goal, but some paths are clearer than others. Valuable tests are the ones that tell a compelling story.
Come on a journey of discovery to learn how to write such tests, and witness a demonstration of these principles in action, with live coding of Serenity BDD automated tests.
Behaviour-Driven Development (BDD) is a game changer for the whole team! Behaviour Driven Development is a powerful collaboration technique that can empower teams to deliver higher value features to the business faster and more effectively. More than just a testing technique, BDD is both a collaboration and a verification tool, and a vital step on the road to Continuous Delivery.
Think BDD is just for web sites? Think again! In this talk, we rethink traditional software testing strategies in the context of micro-services and Behaviour-Driven Development. We will see how traditional testing approaches are both inadequate and poorly targeted for micro-services development. We will learn how to use BDD techniques to discover, describe and document micro-service requirements, and tools like Cucumber and Serenity to turn these requirements into automated acceptance tests and living documentation. We will see how Consumer-Driven Contract tools help ensure that micro-services play well together, and how you can implement the details with the help of unit-testing tools like Spock and REST-Assured.
Behaviour Driven Development is a powerful collaboration technique that can empower teams to deliver higher value features to the business faster and more effectively. But although Behaviour Driven Development is based on a number of simple principles, it can go dramatically wrong in a myriad of different ways.
In this talk we discuss twelve BDD anti-patterns we frequently encounter in real-world BDD projects, anti-patterns that can dramatically reduce the effectiveness of BDD as a practice, and that can even cause BDD adoption to fail entirely. Looking at everything from insufficient collaboration practices to poor use of test automation tooling, from teams that test too much to teams that forget the most important scenarios, we will look at the many different ways that BDD can go wrong, and how it should be done.
We will use real-world examples to illustrate each of these anti-patterns. You will learn how to spot these issues in your own projects, and more importantly how to avoid them in the first place.
Behaviour Driven Development is an increasingly popular Agile practice that turns testing on its head, and involves a major shift in the role testers play in a project. Although popularly associated with automated acceptance testing and tools like Cucumber, BDD actually has much broader applications. In this talk, we will look at how Behaviour Driven Development radically changes the traditional tester role in Agile projects, and empowers them to tangibly contribute much more to the successful outcomes of the project. We will see how collaboratively discussing and defining acceptance criteria help reduce assumptions and errors in the early phases of the project, and help ensure that the features being built are well understood, testable, and valuable to the business. We will look at ways to write more effective, easier to maintain automated acceptance criteria, that free testers to do more productive testing tasks such as exploratory testing. And we will see how automated and manual acceptance test reporting can be combined to provide valuable progress, product documentation and release preparation reporting.
Slides from the London Agile Testing Meetup of November 25 2014:
John Ferguson Smart is a specialist in BDD, automated testing and software life cycle development optimization. John is a well-known speaker at many international conferences and events and an accomplished author (John's new book BDD in Action was published last month).
John presents a talk discussing how to write solid, reliable and maintainable automated web tests using the best-of-breed open source technologies like Selenium WebDriver, Serenity, JBehave and Cucumber.
Behaviour-Driven Development (BDD) is a game changer for the whole team! More than just a testing technique, BDD is both a collaboration and a verification tool, and a vital step on the road to Continuous Delivery. In this session, you will learn what BDD is about, its benefits, and how it affects development teams and processes. But you will also see BDD techniques applied to a real project using tools like JBehave, Cucumber, Selenium 2, Thucydides and more!
- Learn how BDD helps teams focus on discovering and delivering the features that really matter! - Learn what it takes to write more relevant and more maintainable automated acceptance tests - Discover how a well-designed set of automated acceptance criteria can also be a powerful documentation and reporting tool. - See where BDD fits into a Continuous Delivery pipeline.
- And learn how product owners use BDD and Thucydides to drive, coordinate and document releases.
Learn how much more there is to BDD than just “Given..When..Then”!
First Steps with Globus Compute Multi-User EndpointsGlobus
In this presentation we will share our experiences around getting started with the Globus Compute multi-user endpoint. Working with the Pharmacology group at the University of Auckland, we have previously written an application using Globus Compute that can offload computationally expensive steps in the researcher's workflows, which they wish to manage from their familiar Windows environments, onto the NeSI (New Zealand eScience Infrastructure) cluster. Some of the challenges we have encountered were that each researcher had to set up and manage their own single-user globus compute endpoint and that the workloads had varying resource requirements (CPUs, memory and wall time) between different runs. We hope that the multi-user endpoint will help to address these challenges and share an update on our progress here.
Experience our free, in-depth three-part Tendenci Platform Corporate Membership Management workshop series! In Session 1 on May 14th, 2024, we began with an Introduction and Setup, mastering the configuration of your Corporate Membership Module settings to establish membership types, applications, and more. Then, on May 16th, 2024, in Session 2, we focused on binding individual members to a Corporate Membership and Corporate Reps, teaching you how to add individual members and assign Corporate Representatives to manage dues, renewals, and associated members. Finally, on May 28th, 2024, in Session 3, we covered questions and concerns, addressing any queries or issues you may have.
For more Tendenci AMS events, check out www.tendenci.com/events
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.
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Globus
The Earth System Grid Federation (ESGF) is a global network of data servers that archives and distributes the planet’s largest collection of Earth system model output for thousands of climate and environmental scientists worldwide. Many of these petabyte-scale data archives are located in proximity to large high-performance computing (HPC) or cloud computing resources, but the primary workflow for data users consists of transferring data, and applying computations on a different system. As a part of the ESGF 2.0 US project (funded by the United States Department of Energy Office of Science), we developed pre-defined data workflows, which can be run on-demand, capable of applying many data reduction and data analysis to the large ESGF data archives, transferring only the resultant analysis (ex. visualizations, smaller data files). In this talk, we will showcase a few of these workflows, highlighting how Globus Flows can be used for petabyte-scale climate analysis.
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.
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisGlobus
JASMIN is the UK’s high-performance data analysis platform for environmental science, operated by STFC on behalf of the UK Natural Environment Research Council (NERC). In addition to its role in hosting the CEDA Archive (NERC’s long-term repository for climate, atmospheric science & Earth observation data in the UK), JASMIN provides a collaborative platform to a community of around 2,000 scientists in the UK and beyond, providing nearly 400 environmental science projects with working space, compute resources and tools to facilitate their work. High-performance data transfer into and out of JASMIN has always been a key feature, with many scientists bringing model outputs from supercomputers elsewhere in the UK, to analyse against observational or other model data in the CEDA Archive. A growing number of JASMIN users are now realising the benefits of using the Globus service to provide reliable and efficient data movement and other tasks in this and other contexts. Further use cases involve long-distance (intercontinental) transfers to and from JASMIN, and collecting results from a mobile atmospheric radar system, pushing data to JASMIN via a lightweight Globus deployment. We provide details of how Globus fits into our current infrastructure, our experience of the recent migration to GCSv5.4, and of our interest in developing use of the wider ecosystem of Globus services for the benefit of our user community.
Cyaniclab : Software Development Agency Portfolio.pdfCyanic lab
CyanicLab, an offshore custom software development company based in Sweden,India, Finland, is your go-to partner for startup development and innovative web design solutions. Our expert team specializes in crafting cutting-edge software tailored to meet the unique needs of startups and established enterprises alike. From conceptualization to execution, we offer comprehensive services including web and mobile app development, UI/UX design, and ongoing software maintenance. Ready to elevate your business? Contact CyanicLab today and let us propel your vision to success with our top-notch IT solutions.
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?XfilesPro
Worried about document security while sharing them in Salesforce? Fret no more! Here are the top-notch security standards XfilesPro upholds to ensure strong security for your Salesforce documents while sharing with internal or external people.
To learn more, read the blog: https://www.xfilespro.com/how-does-xfilespro-make-document-sharing-secure-and-seamless-in-salesforce/
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTier1 app
Even though at surface level ‘java.lang.OutOfMemoryError’ appears as one single error; underlyingly there are 9 types of OutOfMemoryError. Each type of OutOfMemoryError has different causes, diagnosis approaches and solutions. This session equips you with the knowledge, tools, and techniques needed to troubleshoot and conquer OutOfMemoryError in all its forms, ensuring smoother, more efficient Java applications.
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.
Why React Native as a Strategic Advantage for Startup Innovation.pdfayushiqss
Do you know that React Native is being increasingly adopted by startups as well as big companies in the mobile app development industry? Big names like Facebook, Instagram, and Pinterest have already integrated this robust open-source framework.
In fact, according to a report by Statista, the number of React Native developers has been steadily increasing over the years, reaching an estimated 1.9 million by the end of 2024. This means that the demand for this framework in the job market has been growing making it a valuable skill.
But what makes React Native so popular for mobile application development? It offers excellent cross-platform capabilities among other benefits. This way, with React Native, developers can write code once and run it on both iOS and Android devices thus saving time and resources leading to shorter development cycles hence faster time-to-market for your app.
Let’s take the example of a startup, which wanted to release their app on both iOS and Android at once. Through the use of React Native they managed to create an app and bring it into the market within a very short period. This helped them gain an advantage over their competitors because they had access to a large user base who were able to generate revenue quickly for them.
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Anthony Dahanne
Les Buildpacks existent depuis plus de 10 ans ! D’abord, ils étaient utilisés pour détecter et construire une application avant de la déployer sur certains PaaS. Ensuite, nous avons pu créer des images Docker (OCI) avec leur dernière génération, les Cloud Native Buildpacks (CNCF en incubation). Sont-ils une bonne alternative au Dockerfile ? Que sont les buildpacks Paketo ? Quelles communautés les soutiennent et comment ?
Venez le découvrir lors de cette session ignite
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/
Your Digital Assistant.
Making complex approach simple. Straightforward process saves time. No more waiting to connect with people that matter to you. Safety first is not a cliché - Securely protect information in cloud storage to prevent any third party from accessing data.
Would you rather make your visitors feel burdened by making them wait? Or choose VizMan for a stress-free experience? VizMan is an automated visitor management system that works for any industries not limited to factories, societies, government institutes, and warehouses. A new age contactless way of logging information of visitors, employees, packages, and vehicles. VizMan is a digital logbook so it deters unnecessary use of paper or space since there is no requirement of bundles of registers that is left to collect dust in a corner of a room. Visitor’s essential details, helps in scheduling meetings for visitors and employees, and assists in supervising the attendance of the employees. With VizMan, visitors don’t need to wait for hours in long queues. VizMan handles visitors with the value they deserve because we know time is important to you.
Feasible Features
One Subscription, Four Modules – Admin, Employee, Receptionist, and Gatekeeper ensures confidentiality and prevents data from being manipulated
User Friendly – can be easily used on Android, iOS, and Web Interface
Multiple Accessibility – Log in through any device from any place at any time
One app for all industries – a Visitor Management System that works for any organisation.
Stress-free Sign-up
Visitor is registered and checked-in by the Receptionist
Host gets a notification, where they opt to Approve the meeting
Host notifies the Receptionist of the end of the meeting
Visitor is checked-out by the Receptionist
Host enters notes and remarks of the meeting
Customizable Components
Scheduling Meetings – Host can invite visitors for meetings and also approve, reject and reschedule meetings
Single/Bulk invites – Invitations can be sent individually to a visitor or collectively to many visitors
VIP Visitors – Additional security of data for VIP visitors to avoid misuse of information
Courier Management – Keeps a check on deliveries like commodities being delivered in and out of establishments
Alerts & Notifications – Get notified on SMS, email, and application
Parking Management – Manage availability of parking space
Individual log-in – Every user has their own log-in id
Visitor/Meeting Analytics – Evaluate notes and remarks of the meeting stored in the system
Visitor Management System is a secure and user friendly database manager that records, filters, tracks the visitors to your organization.
"Secure Your Premises with VizMan (VMS) – Get It Now"
Unleash Unlimited Potential with One-Time Purchase
BoxLang is more than just a language; it's a community. By choosing a Visionary License, you're not just investing in your success, you're actively contributing to the ongoing development and support of BoxLang.
Accelerate Enterprise Software Engineering with PlatformlessWSO2
Key takeaways:
Challenges of building platforms and the benefits of platformless.
Key principles of platformless, including API-first, cloud-native middleware, platform engineering, and developer experience.
How Choreo enables the platformless experience.
How key concepts like application architecture, domain-driven design, zero trust, and cell-based architecture are inherently a part of Choreo.
Demo of an end-to-end app built and deployed on Choreo.
Accelerate Enterprise Software Engineering with Platformless
Cucumber and Spock Primer
1. Cucumber and Spock Primer
BDD Masterclass
Building software that makes a difference, and building it well
@wakaleo
www.johnfergusonsmart.com
reachme@johnfergusonsmart.com
3. Overview
Overview
Basic Gherkin
Feature: Earning Frequent Flyer points through flights
Scenario: Economy flights earn points by distance
Given the distance from London to Paris is 344 km
When I fly from London to Paris in Economy
Then I should earn 344 points
A feature represents a
deliverable piece of functionality
Each feature should
have a title
A feature contains one
or more scenarios
Features and Scenarios
4. Overview
Overview
Basic Gherkin
Feature: Earning Frequent Flyer points through flights
In order to encourage repeat business
As an Airline Sales Manager
I want customers to be able to cumulate points when they
fly with us
Scenario: Economy flights earn points by distance
Economy class earns 1 point per kilometre
Given the distance from London to Paris is 344 km
When I fly from London to Paris in Economy
Then I should earn 344 points
Free-text description
(great for living documentation)
You can also put a description
for a Scenario
Free text descriptions
5. Overview
Overview
Basic Gherkin
Scenario: Economy flights earn points by distance
Economy class earns 1 point per kilometre
Given the distance from London to Paris is 344 km
When I fly from London to Paris in Economy
Then I should earn 344 points
GIVEN: Preconditions
WHEN: Action to illustrate
THEN: Expected outcome
Scenarios
6. Overview
Overview
Basic Gherkin
Scenario: Economy flights over several legs
Given the distance from London to Paris is 344 km
And the distance from Paris to Krakow is 1500 km
When I fly from London to Krakow via Paris in Economy
Then I should earn 1844 points
And I should earn 18 status points
Multiple preconditions
Scenarios
Multiple outcomes
7. Overview
Overview
Basic Gherkin
Given steps
✓ Defines preconditions and context
✓ Typically something that happened in the past
✓ Can interact with the system
✓ Should not perform any actions being tested by the
scenario
Given a user registers on the site
And the user logs in
When the home page appears
Then the user’s name should be visible
Given a user has registered on the site
When the user logs in
Then the user’s name should be visible on
the home page
What are we testing here?
8. Overview
Overview
Basic Gherkin
When steps
✓ The action under test
✓ Avoid chaining too many clauses
Given a user has registered on the site
When the user enters 'Scott' in the user name
And the user enters 'Tiger' in the password
And the user selects 'UK' as the country
And the user clicks on the Login button
And the user validates the Cookies alert
Then the user’s name should be visible on the home page
Too much detail
To implementation-specific
9. Overview
Overview
Basic Gherkin
Then steps
✓ The expected outcome
✓ Can query the system
✓ Should not perform actions on the system
Given a batch file needs to be processed
When the user uploads the batch file
Then the result should be visible
And a notification message should be sent to the user
10. Overview
Overview
Basic Gherkin
Background steps
✓ Common steps for all the scenarios in a feature file
✓ Avoid duplication
✓ More focused scenarios
Feature: Earning Frequent Flyer points through flights
In order to encourage repeat business
As an Airline Sales Manager
I want customers to be able to cumulate points when
they fly with us
Background:
Given the distance from London to Paris is 344 km
And the distance from Paris to Krakow is 1500km
Scenario: Economy flights earn points by distance
When I fly from London to Paris in Economy
Then I should earn 344 points
And I should earn 3 status points
Scenario: Economy flights over several legs
When I fly from London to Krakow via Paris in Economy
Then I should earn 1844 points
And I should earn 18 status points
11. Overview
Overview
Basic Gherkin
Scenario Outlines
✓ Use a table to simplify duplicated but similar scenarios
Background:
Given the distance from London to Paris is 344 km
And the distance from Paris to Krakow is 1500km
And the distance from London to Budapest is 1600km
Scenario: Economy flights earn points by distance
When I fly from London to Paris in Economy
Then I should earn 344 points
And I should earn 3 status points
Scenario: Economy flights to Krakow
When I fly from London to Krakow in Economy
Then I should earn 1500 points
And I should earn 15 status points
Scenario: Economy flights to Budapest
When I fly from London to Budapest in Economy
Then I should earn 1600 points
And I should earn 16 status points
12. Overview
Overview
Basic Gherkin
Scenario Outlines
✓ Use a table to simplify duplicated but similar scenarios
Background:
Given the distance from London to Paris is 344 km
And the distance from Paris to Krakow is 1500km
And the distance from London to Budapest is 1600km
Scenario Outline:
When I fly from <departure> to <destination> in Economy
Then I should earn <points> points
And I should earn <status-points> status points
Examples:
| departure | destination | points | status-points |
| London | Paris | 344 | 3 |
| Paris | Krakow | 1500 | 15 |
| London | Budapest | 1600 | 16 |
13. Overview
Overview
Basic Gherkin
Embedded tables
✓ Use tables in steps to pass tabular data to the step
Scenario: Deposit into a current account
Given Joe has the following accounts:
| Number | Type | Balance |
| 123456 | Current | 1000 |
When he deposits €100 into his Current account
Then he should have the following balances:
| Number | Type | Balance |
| 123456 | Current | 1100 |
14. Overview
Overview
Basic Gherkin
Embedded tables
✓ Use tables in steps to pass tabular data to the step
Feature: Earning Frequent Flyer points through flights
In order to encourage repeat business
As an Airline Sales Manager
I want customers to be able to cumulate points when they fly with us
Background:
Given the following flight routes:
| departure | destination | distance |
| London | Paris | 344 |
| Paris | Krakow | 1500 |
| London | Budapest | 1600 |
Scenario Outline:
When I fly from <departure> to <destination> in Economy
Then I should earn <points> points
And I should earn <status-points> status points
Examples:
| departure | destination | points | status-points |
| London | Paris | 344 | 3 |
| Paris | Krakow | 1500 | 15 |
| London | Budapest | 1600 | 16 |
15. Overview
Overview
Basic Gherkin
Multi-line string parameters
✓ Pass in multi-line strings as parameters
Given a travel provides feedback about the flight
"""
It was OK
The food was rubbish but the staff were nice
The flight was delayed by 15 minutes
"""
17. Step Definitions
in Java with
Cucumber and
Serenity BDD
The Cucumber Test Runner
import cucumber.api.CucumberOptions;
import net.serenitybdd.cucumber.CucumberWithSerenity;
import org.junit.runner.RunWith;
@RunWith(CucumberWithSerenity.class)
@CucumberOptions(features = "src/test/resources/features/deposit_funds",
glue = "com.bddinaction.serenitybank")
public class DepositFunds {}
A Cucumber test runner
Which feature files to run
Where to find the step definition classes
18. Step Definitions
in Java with
Cucumber and
Serenity BDD
Step Definitions
Feature: Earning Frequent Flyer points through flights
Scenario: Economy flights earn points by distance
Given the distance from London to Paris is 344 km
When I fly from London to Paris in Economy
Then I should earn 344 points
@Given("^the distance from (.*) to (.*) is (d+) km$")
public void pointsEarnedBetweenCities(String departure,
String destination,
int distance)
throws Throwable {
}
@Given, @When, or @Then annotation
Matching regular expression
Matched expressions are passed in as parameters
19. Step Definitions
in Java with
Cucumber and
Serenity BDD
Matching Lists
Given the following possible destinations: London, Paris, Amsterdam
@Given("^the following possible destinations: (.*)$")
public void theFollowingPossibleDestinations(List<String> destinations) {
}
Declare a list of Strings
Given the following possible destinations:
| London |
| Paris |
| Amsterdam |
alternative notation
20. Step Definitions
in Java with
Cucumber and
Serenity BDD
Matching enums
When I fly from London to Paris in Economy
public enum City {
London, Paris, Amsterdam
}
public enum CabinClass {
Economy, Business, First
}
@When("^I fly from (.*) to (.*) in (.*)$")
public void iFly(City departure, City destination, CabinClass cabinClass){
}
Enums are matched automatically
21. Step Definitions
in Java with
Cucumber and
Serenity BDD
Matching tables
Given the following flight routes:
| departure | destination | distance |
| London | Paris | 344 |
| Paris | Krakow | 1500 |
| London | Budapest | 1600 |
public void flightRoutes(Map<String, String> flightRoutes) {}
Tables can be passed as a map of Strings
22. Step Definitions
in Java with
Cucumber and
Serenity BDD
Transformers
When I fly from San Francisco to Paris in Economy
public enum City {
London("London"),
Paris("Paris"),
SanFrancisco("San Francisco"),
SaintPetersbuug("St Petersburg");
public final String name;
City(String name) { this.name = name; }
}
@When("^I fly from (.*) to (.*) in (.*)$")
public void iFly(@Transform(CityConverter.class) City departure,
@Transform(CityConverter.class) City destination,
CabinClass cabinClass) {}
public class CityConverter extends Transformer<City> {
@Override
public City transform(String cityName) {
return Arrays.stream(City.values())
.filter(city -> city.name.equalsIgnoreCase(cityName))
.findFirst()
.orElseThrow(() -> new UnknownCityException(cityName));
}
}
24. Overview
Overview
Introduction
to Spock
http://spockframework.org/
import spock.lang.Specification
class WhenManagingAnAccount extends Specification {
def "depositing a sum into the account should update the balance"() {
given:
def currentAccount = new BankAccount("123456", AccountType.Current)
when:
currentAccount.deposit(1000)
then:
currentAccount.balance == 1000
}
}
All Spock tests extend Specification
Plain English test names
Arrange
Act
Assert
Acts as an assertion
25. Overview
Overview
Using Fields
class WhenWithdrawingFunds extends Specification {
def accountService = new AccountService();
def "withdrawing funds from a current account"() {
given:
def accountNumber = accountService.createNewAccount(Current, 100.00)
when:
accountService.makeWithdrawal(accountNumber, 50.00, LocalDate.now())
then:
accountService.getBalance(accountNumber) == 50.00
}
def "withdrawing funds from a savings account"() {
given:
def accountNumber = accountService.createNewAccount(BigSaver, 1000.00)
when:
accountService.makeWithdrawal(accountNumber, 50.00, LocalDate.now())
then:
thrown(MinimumBalanceRequiredException)
and:
accountService.getBalance(accountNumber) == 1000.00
}
}
Instantiated once before each test
26. Overview
Overview
Using Fields
class WhenWithdrawingFunds extends Specification {
@Shared def accountService = new AccountService()
def "withdrawing funds from a current account"() {
given:
def accountNumber = accountService.createNewAccount(Current, 100.00)
when:
accountService.makeWithdrawal(accountNumber, 50.00, LocalDate.now())
then:
accountService.getBalance(accountNumber) == 50.00
}
def "withdrawing funds from a savings account"() {
given:
def accountNumber = accountService.createNewAccount(BigSaver, 1000.00)
when:
accountService.makeWithdrawal(accountNumber, 50.00, LocalDate.now())
then:
thrown(MinimumBalanceRequiredException)
and:
accountService.getBalance(accountNumber) == 1000.00
}
}
Instantiated once and shared between the tests
27. Overview
Overview
Using Fields
class WhenWithdrawingFunds extends Specification {
def accountService
def setup() {
accountService = new AccountService()
}
def "withdrawing funds from a current account"() {
given:
def accountNumber = accountService.createNewAccount(Current, 100.00)
when:
accountService.makeWithdrawal(accountNumber, 50.00, LocalDate.now())
then:
accountService.getBalance(accountNumber) == 50.00
}
def "withdrawing funds from a savings account"() {
given:
def accountNumber = accountService.createNewAccount(BigSaver, 1000.00)
when:
accountService.makeWithdrawal(accountNumber, 50.00, LocalDate.now())
then:
thrown(MinimumBalanceRequiredException)
and:
accountService.getBalance(accountNumber) == 1000.00
}
}
Runs before each test
28. Overview
Overview
Using Fields
class WhenWithdrawingFunds extends Specification {
@Shared def accountService = new AccountService()
def setupSpec() {
accountService = new AccountService()
}
def "withdrawing funds from a current account"() {
given:
def accountNumber = accountService.createNewAccount(Current, 100.00)
when:
accountService.makeWithdrawal(accountNumber, 50.00, LocalDate.now())
then:
accountService.getBalance(accountNumber) == 50.00
}
def "withdrawing funds from a savings account"() {
given:
def accountNumber = accountService.createNewAccount(BigSaver, 1000.00)
when:
accountService.makeWithdrawal(accountNumber, 50.00, LocalDate.now())
then:
thrown(MinimumBalanceRequiredException)
and:
accountService.getBalance(accountNumber) == 1000.00
}
}
Runs once at the start of the Specification
See also cleanup() and cleanupSpec()
29. Overview
Overview
Exceptions
class WhenWithdrawingFunds extends Specification {
@Shared def accountService = new AccountService()
def "withdrawing funds from a savings account"() {
given:
def accountNumber = accountService.createNewAccount(BigSaver, 1000.00)
when:
accountService.makeWithdrawal(accountNumber, 50.00,
LocalDate.now())
then:
thrown(MinimumBalanceRequiredException)
and:
accountService.getBalance(accountNumber) == 1000.00
}
}
Expect this exception to be thrown
Also, the balance should be unchanged
30. Overview
Overview
Exceptions
def "withdrawing funds from a savings account"() {
given:
def accountNumber = accountService.createNewAccount(BigSaver, 1000.00)
when:
accountService.makeWithdrawal(accountNumber, 50.00, LocalDate.now())
then:
MinimumBalanceRequiredException exception = thrown()
and:
exception.message == "Minimum balance for this account is €1000.00"
and:
accountService.getBalance(accountNumber) == 1000.00
}
Expect this exception to be thrown
Check exception attributes
31. Overview
Overview
Data-Driven
Specifications
class WhenCalculatingDepositFees extends Specification {
def “correct deposit should be calculated"() {
expect:
DepositFee.forAccountType(accountType).apply(amount) == expectedDepositFee
where:
accountType | amount | expectedDepositFee
Current | 1000.0 | 0.0
BasicSavings | 100.00 | 0.50
BigSaver | 10.00 | 0.50
BigSaver | 100.01 | 0.75
BigSaver | 1000.01 | 1.25
}
}
Use these variables in the test
32. Overview
Overview
Data-Driven
Specifications
class WhenCalculatingDepositFees extends Specification {
@Unroll
def “A deposit of #amount in an #accountType account"() {
expect:
DepositFee.forAccountType(accountType).apply(amount) == expectedDepositFee
where:
accountType | amount | expectedDepositFee
Current | 1000.0 | 0.0
BasicSavings | 100.00 | 0.50
BigSaver | 10.00 | 0.50
BigSaver | 100.01 | 0.75
BigSaver | 1000.01 | 1.25
}
}
Table variables can be placed in the test title
Report a separate test for each row of data
33. Overview
Overview
Test Doubles
✓ Test Doubles
✓ Stand-ins for dependencies
✓ Transparently replace objects used by
the class under test
✓ Make tests faster and easier to write
34. Overview
Overview
Test Doubles
✓ Test Doubles stand in for objects that are
✓ Unavailable or unfinished
✓ Slow
✓ Needs something that is unavailable
✓ Hard to instantiate
43. Overview
Overview
Test Doubles
✓ Mocks
✓ Only mock what you own
✓ Verify specification, not implementation
✓ Specify as little as possible in a test
✓ Only mock your immediate neighbours
✓ Don’t mock boundary objects
✓ Don’t mock domain objects
✓ Keep it simple
44. Overview
Overview
Test Doubles
in Spock
def vatService = Mock(VATService)
def seller = new Seller(vatService);
def “VAT should apply on ordinary articles"() {
given: "the VAT rate for shirts is 20%"
seller = new Seller(vatService);
vatService.getRateFor("shirt") >> 0.2
and: "we are selling a shirt"
def sale = seller.sells(1, "shirt").forANetPriceOf(10.00)
when: "we calculate the price including VAT"
def totalPrice = sale.totalPrice
then: "the price should include GST of 20%"
totalPrice == 12.00
}
The seller thinks he is using a real VATService
Create a mocked version of the VATService class
Stubbed return value for the getRateFor() method
45. Overview
Overview
Test Doubles
in Spock
def vatService = Mock(VATService)
…
VATService vatService = Mock()
You can create a mock object in two ways
(This way is more IDE-friendly)
def vatService = Mock(VATService)
…
VATService vatService = Mock()
Creating Mocks
46. Overview
Overview
Test Doubles
in Spock
def vatService = Stub(VATService)
…
VATService vatService = Stub()
A Stub returns empty or “dummy” responses for all method calls
(This way is more IDE-friendly)
Creating Stubs
47. Overview
Overview
Test Doubles
in Spock
vatService.getRateFor("shirt") >> 0.2
Mock the result of a particular method call
Return different values on successive calls
vatService.getRateFor("shirt") >>> [0.2, 0.1]
vatService.getRateFor("shirt") >>
{ throw new UnknownProductException()}
Do something in a closure
Mocking interactions
VATService vatService = Mock() {
getRateFor("shirt") >> 0.2
getRateFor("banana") >> 0.1
}
Mock the interactions at creation time
48. Overview
Overview
Test Doubles
in Spock
def "The VAT Service should be used to obtain VAT values"() {
given: "the GST rate for shirts is 10%"
seller = new Seller(vatService);
vatService.getRateFor("shirt") >> 0.1
when: "we sell a shirt"
seller.sells(1, "shirt").forANetPriceOf(10.00)
then: "the VAT service should be used to determine the GST rate"
1 * vatService.getRateFor("shirt")
}
This method should be called exactly once
Checking interactions
49. Overview
Overview
Interactions in
Spock
1 * vatService.getRateFor("shirt") // Exactly once with this parameter
(1.._) * vatService.getRateFor("shirt") // At least once
(_..2) * vatService.getRateFor("shirt") // No more than twice
vatService.getRateFor(_) // Called with any parameter
vatService.getRateFor({it != "banana"}) // Custom constraint
Checking interactions
50. Overview
Overview
Documentation
def "withdrawing funds from a current account"() {
given: "a current account with €100"
def accountNumber = accountService.createNewAccount(Current, 100.00)
when: "we withdraw €50"
accountService.makeWithdrawal(accountNumber, 50.00, LocalDate.now())
then: "the balance should be €50"
accountService.getBalance(accountNumber) == 50.00
}
Descriptive texts go after the labels
51. Thank You!
AUTHOR OF ‘BDD IN ACTION’
@wakaleo
www.johnfergusonsmart.com
reachme@johnfergusonsmart.com