This document provides an overview of test driven development (TDD). It discusses unit testing, refactoring, and the TDD process. The TDD process involves writing a failing test first, then code to pass the test, and refactoring code as needed. Adopting TDD practices can improve code quality and catch defects earlier. Examples are provided to illustrate applying TDD to a login feature.
VT.NET 20160411: An Intro to Test Driven Development (TDD)Rob Hale
This document provides an introduction to test-driven development (TDD). It discusses the benefits of unit testing over end-to-end testing, including error localization, execution time, tighter feedback loops, and test coverage. It defines what constitutes a unit test and what does not. Examples of difficult scenarios to unit test are given. The basic TDD cycle of writing a failing test, making the test pass, and refactoring is explained. An exercise demonstrates applying TDD principles. Mock objects and the differences between the Chicago and London schools of TDD are briefly covered. Finally, additional resources on TDD are listed.
Test driven development (TDD), a software development method, helps build high quality applications faster. Life-cycle, usefulness, limitations and similar techniques of TDD have been presented in this slide deck.
This document provides an overview of test-driven development (TDD). It defines TDD as a technique for building software where tests are written before code to guide development. The key aspects of TDD covered are:
- Writing tests first before code, which helps improve design and ensures tests are written.
- The TDD mantra of Red-Green-Refactor, where tests initially fail (Red), code is written to pass tests (Green), then code is refactored to improve design.
- An example case study of a large Java project developed using TDD that has over 20,000 lines of unit tests providing over 90% test coverage.
ATDD (Acceptance Test Driven Development) is a practice where the team discusses acceptance criteria and tests needed to ensure a feature meets user expectations. It has four stages: discuss functionality and tests, define test scenarios and data, develop using TDD, and demo tests to stakeholders. A sample shows a calculator user story, criteria, and tests for adding, subtracting, etc. ATDD improves understanding, collaboration, and catches defects earlier.
Test-Driven Development is about approaching software development from a test perspective and knowing how to use the tools (e.g. JUnit, Mockito) to effectively write tests.
Source code examples @...
https://github.com/codeprimate-software/test-driven-development
This document provides an overview of test-driven development (TDD). TDD involves writing tests before writing code to ensure new functionality works as intended. Key principles of TDD include writing failing tests first, then code to pass the tests, and refactoring code while maintaining all tests. TDD results in higher quality, flexible, readable and maintainable code. It also helps improve both internal code quality and external functionality through a well-designed development process focused on automated testing.
This document provides an overview of test-driven development (TDD). It discusses what TDD is, how the TDD process works through iterations of writing tests first then code, and the benefits it provides like increased confidence in changes and documentation of requirements. The document covers TDD basics like the red-green-refactor cycle and challenges in unit testing like dependencies. It emphasizes focusing on writing tests before code and not designing code in your head first. The document also compares mocking frameworks and argues the benefits of commercial frameworks like Typemock Isolator.
VT.NET 20160411: An Intro to Test Driven Development (TDD)Rob Hale
This document provides an introduction to test-driven development (TDD). It discusses the benefits of unit testing over end-to-end testing, including error localization, execution time, tighter feedback loops, and test coverage. It defines what constitutes a unit test and what does not. Examples of difficult scenarios to unit test are given. The basic TDD cycle of writing a failing test, making the test pass, and refactoring is explained. An exercise demonstrates applying TDD principles. Mock objects and the differences between the Chicago and London schools of TDD are briefly covered. Finally, additional resources on TDD are listed.
Test driven development (TDD), a software development method, helps build high quality applications faster. Life-cycle, usefulness, limitations and similar techniques of TDD have been presented in this slide deck.
This document provides an overview of test-driven development (TDD). It defines TDD as a technique for building software where tests are written before code to guide development. The key aspects of TDD covered are:
- Writing tests first before code, which helps improve design and ensures tests are written.
- The TDD mantra of Red-Green-Refactor, where tests initially fail (Red), code is written to pass tests (Green), then code is refactored to improve design.
- An example case study of a large Java project developed using TDD that has over 20,000 lines of unit tests providing over 90% test coverage.
ATDD (Acceptance Test Driven Development) is a practice where the team discusses acceptance criteria and tests needed to ensure a feature meets user expectations. It has four stages: discuss functionality and tests, define test scenarios and data, develop using TDD, and demo tests to stakeholders. A sample shows a calculator user story, criteria, and tests for adding, subtracting, etc. ATDD improves understanding, collaboration, and catches defects earlier.
Test-Driven Development is about approaching software development from a test perspective and knowing how to use the tools (e.g. JUnit, Mockito) to effectively write tests.
Source code examples @...
https://github.com/codeprimate-software/test-driven-development
This document provides an overview of test-driven development (TDD). TDD involves writing tests before writing code to ensure new functionality works as intended. Key principles of TDD include writing failing tests first, then code to pass the tests, and refactoring code while maintaining all tests. TDD results in higher quality, flexible, readable and maintainable code. It also helps improve both internal code quality and external functionality through a well-designed development process focused on automated testing.
This document provides an overview of test-driven development (TDD). It discusses what TDD is, how the TDD process works through iterations of writing tests first then code, and the benefits it provides like increased confidence in changes and documentation of requirements. The document covers TDD basics like the red-green-refactor cycle and challenges in unit testing like dependencies. It emphasizes focusing on writing tests before code and not designing code in your head first. The document also compares mocking frameworks and argues the benefits of commercial frameworks like Typemock Isolator.
The document discusses Acceptance Test Driven Development (ATDD), where acceptance tests are used to define requirements and drive the development process. It describes how ATDD works through a cycle of writing examples and tests, implementing features to pass the tests, and ensuring the tests continue to pass as changes are made. The benefits of ATDD include improved collaboration, a shared understanding of requirements, and preventing defects. Various tools that can be used for ATDD are also outlined, including FIT and Robot Framework. Adopting ATDD requires training, evangelism, and addressing organizational challenges through shared understanding.
This document discusses test-driven development (TDD), behavior-driven development (BDD), and acceptance test-driven development (ATDD). It explains that while they have different names, they all share the same core idea of using examples from business requirements to create automated tests. The document provides examples of how to write tests before having a user interface, and recommends abstracting from the GUI to focus on business logic. It also lists some popular tools that can be used for ATDD, BDD, and TDD.
4 Nisan 2015 tarihinde Kadir Has Üniversitesi'nde yapılan 9. Yazılım Teknolojileri Seminer etkinliğinde Eralp Erat'ın yaptığı TDD (Test Driven Design) sunumu
The document discusses test-driven development (TDD). TDD involves writing tests before writing code to specify desired functionality, then writing just enough code to pass each test. This process of red-green-refactor evolves the system design through tests. TDD results in decoupled, well-designed code and provides benefits like confidence, documentation, and safe refactoring. The document also provides tips for writing better tests, such as keeping tests small, expressive, isolated, and automated.
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
This document discusses Test Driven Development (TDD). It defines TDD, outlines the TDD process which involves writing tests first and then code to pass the tests, and emphasizes refactoring. Benefits of TDD include improved code quality, reduced bugs, and serving as documentation. Key TDD terms and libraries like JUnit and Mockito are explained. Continuous Integration (CI) is also discussed as it automates testing and builds when code is committed.
Test Driven Development (TDD) Preso 360|Flex 2010guest5639fa9
This document discusses Test Driven Development (TDD) using FlexUnit 4. It provides an overview of TDD and its benefits. It then walks through an example of building a Twitter client application using TDD. It demonstrates how to create test suites and test cases, write tests to fail initially, then write code to pass the tests. It covers concepts like user stories, assertions, refactoring tests. The document recommends TDD for APIs, frameworks and services, but not GUI testing. It provides resources to learn more about TDD with FlexUnit 4 and Adobe technologies.
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.
ATDD is about improving communication between stakeholders to develop the right product. It involves collaboratively specifying requirements using examples of desired system behaviors in a testable format. These executable specifications are then automated as tests to prevent defects and ensure the system works as intended. SpecFlow is one framework that can be used to automate acceptance criteria written in a Given-When-Then style.
TDD vs. ATDD - What, Why, Which, When & WhereDaniel Davis
This is a slide deck for a discussion about Test Driven Development (TDD) and Acceptance Test Driven Development (ATDD) and starting to explore the differences between them. Get some insight into why we use them and the advantages and disadvantages of both, as well as, get a better understanding of which should be used where and when. By the end of the session you should be well along the path to TDD vs. ATDD enlightenment.
Test-driven development (TDD) is an agile software development process where test cases are developed before code. The TDD process involves writing a test, watching it fail, writing code to pass the test, and refactoring code as needed. TDD encourages dividing work into small pieces and promotes high-quality code by requiring tests to pass before adding new features. While TDD requires more initial time writing tests, it can reduce debugging time and defects in the long run.
The document discusses Behavior Driven Development (BDT) using Microsoft Visual Studio 2010 and SpecFlow, including an overview of BDT, different BDT methodologies, using Gherkin syntax to write scenarios, configuring SpecFlow tests in Visual Studio, and a live demo of SpecFlow.
QA Fest 2017. Владимир Примаков. QA метрики. Взгляд на качество с разных стор...QAFest
Что такое качество продукта и процесса разработки. Как его измерять. Какие метрики гарантируют качество продукта, а какие важны для принятии решения о готовности продукта к релизу. Тренды качества, их польза в понимании улучшения качества продукты и процесса разработки. Абсолютные и относительные метрики. Инструменты.
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...Zohirul Alam Tiemoon
The document discusses Test-Driven Development (TDD) and Acceptance Test-Driven Development (ATDD). It defines TDD and ATDD, provides demos of applying each approach to building a calculator and pet shop application, and discusses how they help keep design simple. Tools for TDD/ATDD and who writes unit/acceptance tests are also covered, along with why the approaches are used.
San Francisco Software Craftsmanship Meetup
Test Driven Developers Bay Area Meetup
TDD Flow: The Mantra in Action” is a talk + hands-on about the mantra of TDD and its core patterns. Here are some questions for this talk: What is TDD? How to write a good test that fails? How to write code enough to make the test pass? How to remove duplication? How to refactor code? How to create clean code? Is TDD about testing or design? How small should a test be? Should I only write unit tests? Should I estimate TDD? How to use TDD with other agile methods like Scrum, Kanban or BDD? And finally, how to flow in TDD?
Software quality is critical to consistently and continually delivering new features to our users. This talk covers the importance of software quality and how to deliver it via unit testing, Test Driven Development and clean code in general.
This is the deck from a talk I gave at Desert Code Camp 2013.
Testing is not something that traditional PHP developers are being familiar with. This session introduces the needs and means for testing, and the test-driven development model to create rock-solid PHP applications.
The document outlines an upcoming programming workshop that will cover various JetBrains IDEs like PyCharm, IntelliJ IDEA, and PhpStorm. It then discusses Test Driven Development (TDD), including what TDD is, the development cycle used in TDD, and benefits like encouraging simple designs and confidence. Different types of software tests are also listed like unit tests, integration tests, acceptance tests, and others. Specific testing techniques like unit testing, integration testing using bottom-up and top-down approaches, and acceptance testing are then explained at a high level. Finally, some important notes on testing like trusting tests and prioritizing maintainability are provided.
This document provides an overview of test-driven development (TDD) in Python. It describes the TDD process, which involves writing a test case that fails, then writing production code to pass that test, and refactoring the code. An example TDD cycle is demonstrated using the FizzBuzz problem. Unit testing in Python using the unittest framework is also explained. Benefits of TDD like improved code quality and safer refactoring are mentioned. Further reading on TDD and testing concepts from authors like Uncle Bob Martin and Kent Beck is recommended.
The document discusses Acceptance Test Driven Development (ATDD), where acceptance tests are used to define requirements and drive the development process. It describes how ATDD works through a cycle of writing examples and tests, implementing features to pass the tests, and ensuring the tests continue to pass as changes are made. The benefits of ATDD include improved collaboration, a shared understanding of requirements, and preventing defects. Various tools that can be used for ATDD are also outlined, including FIT and Robot Framework. Adopting ATDD requires training, evangelism, and addressing organizational challenges through shared understanding.
This document discusses test-driven development (TDD), behavior-driven development (BDD), and acceptance test-driven development (ATDD). It explains that while they have different names, they all share the same core idea of using examples from business requirements to create automated tests. The document provides examples of how to write tests before having a user interface, and recommends abstracting from the GUI to focus on business logic. It also lists some popular tools that can be used for ATDD, BDD, and TDD.
4 Nisan 2015 tarihinde Kadir Has Üniversitesi'nde yapılan 9. Yazılım Teknolojileri Seminer etkinliğinde Eralp Erat'ın yaptığı TDD (Test Driven Design) sunumu
The document discusses test-driven development (TDD). TDD involves writing tests before writing code to specify desired functionality, then writing just enough code to pass each test. This process of red-green-refactor evolves the system design through tests. TDD results in decoupled, well-designed code and provides benefits like confidence, documentation, and safe refactoring. The document also provides tips for writing better tests, such as keeping tests small, expressive, isolated, and automated.
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
This document discusses Test Driven Development (TDD). It defines TDD, outlines the TDD process which involves writing tests first and then code to pass the tests, and emphasizes refactoring. Benefits of TDD include improved code quality, reduced bugs, and serving as documentation. Key TDD terms and libraries like JUnit and Mockito are explained. Continuous Integration (CI) is also discussed as it automates testing and builds when code is committed.
Test Driven Development (TDD) Preso 360|Flex 2010guest5639fa9
This document discusses Test Driven Development (TDD) using FlexUnit 4. It provides an overview of TDD and its benefits. It then walks through an example of building a Twitter client application using TDD. It demonstrates how to create test suites and test cases, write tests to fail initially, then write code to pass the tests. It covers concepts like user stories, assertions, refactoring tests. The document recommends TDD for APIs, frameworks and services, but not GUI testing. It provides resources to learn more about TDD with FlexUnit 4 and Adobe technologies.
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.
ATDD is about improving communication between stakeholders to develop the right product. It involves collaboratively specifying requirements using examples of desired system behaviors in a testable format. These executable specifications are then automated as tests to prevent defects and ensure the system works as intended. SpecFlow is one framework that can be used to automate acceptance criteria written in a Given-When-Then style.
TDD vs. ATDD - What, Why, Which, When & WhereDaniel Davis
This is a slide deck for a discussion about Test Driven Development (TDD) and Acceptance Test Driven Development (ATDD) and starting to explore the differences between them. Get some insight into why we use them and the advantages and disadvantages of both, as well as, get a better understanding of which should be used where and when. By the end of the session you should be well along the path to TDD vs. ATDD enlightenment.
Test-driven development (TDD) is an agile software development process where test cases are developed before code. The TDD process involves writing a test, watching it fail, writing code to pass the test, and refactoring code as needed. TDD encourages dividing work into small pieces and promotes high-quality code by requiring tests to pass before adding new features. While TDD requires more initial time writing tests, it can reduce debugging time and defects in the long run.
The document discusses Behavior Driven Development (BDT) using Microsoft Visual Studio 2010 and SpecFlow, including an overview of BDT, different BDT methodologies, using Gherkin syntax to write scenarios, configuring SpecFlow tests in Visual Studio, and a live demo of SpecFlow.
QA Fest 2017. Владимир Примаков. QA метрики. Взгляд на качество с разных стор...QAFest
Что такое качество продукта и процесса разработки. Как его измерять. Какие метрики гарантируют качество продукта, а какие важны для принятии решения о готовности продукта к релизу. Тренды качества, их польза в понимании улучшения качества продукты и процесса разработки. Абсолютные и относительные метрики. Инструменты.
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...Zohirul Alam Tiemoon
The document discusses Test-Driven Development (TDD) and Acceptance Test-Driven Development (ATDD). It defines TDD and ATDD, provides demos of applying each approach to building a calculator and pet shop application, and discusses how they help keep design simple. Tools for TDD/ATDD and who writes unit/acceptance tests are also covered, along with why the approaches are used.
San Francisco Software Craftsmanship Meetup
Test Driven Developers Bay Area Meetup
TDD Flow: The Mantra in Action” is a talk + hands-on about the mantra of TDD and its core patterns. Here are some questions for this talk: What is TDD? How to write a good test that fails? How to write code enough to make the test pass? How to remove duplication? How to refactor code? How to create clean code? Is TDD about testing or design? How small should a test be? Should I only write unit tests? Should I estimate TDD? How to use TDD with other agile methods like Scrum, Kanban or BDD? And finally, how to flow in TDD?
Software quality is critical to consistently and continually delivering new features to our users. This talk covers the importance of software quality and how to deliver it via unit testing, Test Driven Development and clean code in general.
This is the deck from a talk I gave at Desert Code Camp 2013.
Testing is not something that traditional PHP developers are being familiar with. This session introduces the needs and means for testing, and the test-driven development model to create rock-solid PHP applications.
The document outlines an upcoming programming workshop that will cover various JetBrains IDEs like PyCharm, IntelliJ IDEA, and PhpStorm. It then discusses Test Driven Development (TDD), including what TDD is, the development cycle used in TDD, and benefits like encouraging simple designs and confidence. Different types of software tests are also listed like unit tests, integration tests, acceptance tests, and others. Specific testing techniques like unit testing, integration testing using bottom-up and top-down approaches, and acceptance testing are then explained at a high level. Finally, some important notes on testing like trusting tests and prioritizing maintainability are provided.
This document provides an overview of test-driven development (TDD) in Python. It describes the TDD process, which involves writing a test case that fails, then writing production code to pass that test, and refactoring the code. An example TDD cycle is demonstrated using the FizzBuzz problem. Unit testing in Python using the unittest framework is also explained. Benefits of TDD like improved code quality and safer refactoring are mentioned. Further reading on TDD and testing concepts from authors like Uncle Bob Martin and Kent Beck is recommended.
TDD is a software development technique where unit tests are written before production code to define desired functionality. The TDD cycle involves writing a test that fails, then code to pass the test, and refactoring code while ensuring tests still pass. This forces critical analysis and design while providing a safety net of regression tests. Benefits include feedback that code works, tests as documentation, and improved design through loose coupling and refactoring with confidence from tests.
Test Driven Development, or TDD, is the mainstream in many areas of software development, but what about the database? In this session, we explore TDD, the benefits of automated testing, and how testing data projects differs from other types of development. We introduce the tSQLt testing framework and demonstrate its use with a live coding example. Finally, we will discuss some lessons learned in doing TDD with SQL Server.
Originally presented by Steve Fibich and David Moore at Richmond SQL Server Users Group on January 11, 2018
Ever tried doing Test First Test Driven Development? Ever failed? TDD is not easy to get right. Here's some practical advice on doing BDD and TDD correctly. This presentation attempts to explain to you why, what, and how you should test, tell you about the FIRST principles of tests, the connections of unit testing and the SOLID principles, writing testable code, test doubles, the AAA of unit testing, and some practical ideas about structuring tests.
Test Driven Development (TDD) is a software development process where a developer first writes an automated test case for new code. This test initially fails, then the developer writes the minimum amount of code to pass the test. The code is then refactored. Following the RED-GREEN-REFACTOR cycle, TDD encourages writing tests before code, and helps improve code quality, confidence, and reduces bugs. Research shows teams using TDD take slightly longer to initially develop features but have significantly fewer bugs, faster integration, and reduced overall release times.
Despite the belief that a shared context and collaboration drives quality, too often, software testers and quality professionals struggle to find their place within today's integrated agile teams. This session is a practitioner’s view of testing and testing practices within an iterative/incremental development environment. We will begin with a discussion of some of the challenges of testing within an agile environment and delve into the guiding principles of Agile Testing and key enabling practices. Agile Testing necessitates a change in mindset, and it is as much, if not more, about behavior, as it is about skills and tooling, all of which will be explored.
1. Test Driven Development (TDD) is an agile software development process that involves writing unit tests before developing code. It follows a cycle of writing a failing test, implementing code to pass the test, and refactoring code.
2. TDD can result in lower defect rates and improved code quality through refactoring, though empirical evidence is limited. Common mistakes include forgetting to run tests frequently or writing tests that are too broad.
3. Unit tests should be easy to write and read, reliable, fast, and test individual units of code rather than integrated systems to avoid external dependencies slowing down tests.
This was a workshop given on the UTN University, for the Software Engineering students. The idea is to give a brief explanation about TDD, and how to use it.
This document discusses test-driven development (TDD), a software development technique where test cases are written before implementation code. TDD involves writing a failing test case, then code to pass the test, and refactoring code as needed. Key principles are writing tests first, running tests frequently, and making code changes in small iterative steps. TDD aims to increase code quality and reduce bugs by fully testing code in short cycles.
Unit testing, UI testing and Test Driven Development in Visual Studio 2012Jacinto Limjap
Unit testing, UI testing, and test-driven development (TDD) are explained. Unit testing tests individual units/blocks of code, UI testing automates user interactions, and TDD uses tests to design software. Visual Studio 2012 focuses the testing experience on developers with improvements to Microsoft Test (MS-Test) framework, support for additional frameworks like NUnit and Selenium, and features like continuous testing and code coverage analysis. Demo shows how to do UI testing with Selenium and practice TDD.
The document discusses unit testing and provides guidance on how to effectively implement unit testing. It defines unit testing as testing individual units or components of software code to verify they are functioning as intended. The document outlines best practices for unit testing such as writing test cases that cover valid, invalid, and boundary conditions. It also recommends testing frameworks like JUnit that can automate running test cases. Overall, the document advocates for developing a rigorous unit testing strategy and practicing habits like writing tests first and continuously running tests to improve code quality.
This document provides an introduction to test-driven development (TDD), including its goals, benefits, and challenges. TDD is an iterative, test-first approach to development where functionality and behavior are defined by tests. Tests are written before code and define the desired API and design. Benefits of TDD include reduced defects, increased initial development time, and easier refactoring and collaboration. Adopting TDD requires practice and a focus on good design principles like separation of concerns.
This document provides an overview of how to use TestDirector 8.0 software for test management. It discusses setting up test requirements and cases, creating test sets, executing tests, tracking defects, and analyzing results using reports and graphs. The training objectives are to learn TestDirector functionality and features for managing the entire testing process from one central location. Instructional methods include slides, demonstrations, and hands-on exercises.
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.
Automated Software Testing Framework Training by Quontra SolutionsQuontra Solutions
Learn through Experience -- We differentiate our training and development program by delivering Role-Based training instead of Product-based training. Ultimately, our goal is to deliver the best IT Training to our clients.
In this training, attendees learn:
Introduction to Automation
• What is automation
• Advantages of automation & Disadvantages of automation
• Different types of Automation Tools
• What to automate in projects
• When to start automation. Scope for automation testing in projects
• About open-source automation tools
Introduction to Selenium
• What is selenium
• Why selenium
• Advantage and Disadvantages of selenium
Selenium components
• Selenium IDE
• Selenium RC
• Selenium WebDriver
• Selenium Grid
Selenium IDE
• Introduction to IDE
• IDE Installation
• Installation and uses of Firepath, Firebug & Debug bar
• Property & value of elements
• Selenium commands
• Assertions & Verification
• Running, pausing and debugging script
• Disadvantages of selenium IDE
• How to convert selenium IDE Scripts into other languages
Locators
• Tools to identify elements/objects
• Firebug
• IE Developer tools
• Google Chrome Developer tools
• Locating elements by ID
• Finding elements by name
• Finding elements by link text
• Finding elements by XPath
• Finding Elements by using CSS
• Summary
Selenium RC
• What is selenium RC
• Advantages of RC, Architecture
• What is Eclipse/IntelliJ, Selenium RC configure with Eclipse/IntelliJ
• Creating, running & debugging RC scripts
Java Concepts
• Introduction to OOPs concepts and Java
• Installation: Java, Eclipse/IntelliJ, selenium, TestNg/JUnit
• operators in java
• Data types in java
• Conditional statements in java
• Looping statements in java
• Output statements in java
• Classes & Objects
• Collection Framework
• Regular Expressions
• Exception Handling
• Packages, Access Specifiers /Modifiers
• String handling
• Log4J for logging
Selenium Web Driver with Java
• Introduction to WebDriver
• Advantages
• Different between RC and WebDriver
• Selenium WebDriver- commands
• Generate scripts in Eclipse/IntelliJ. Run Test Scripts.
• Debugging Test Script
• Database Connections
• Assertions, validations
• Working with Excel
• Pass the data from Excel
• Working with multiple browser
• Window Handling, Alert/confirm & Popup Handling
• Mouse events
• Wait mechanism
• Rich Web Handling: Calendar handing, Auto suggest, Ajax, browser forward/back navigation, keyboard events, certificate handling, event listeners
TestNg/JUnit Framework
• What is TestNg/JUnit
• Integrate the Selenium Scripts and Run from TestNg/JUnit
• Reporting Results and Analysis
• Run Scripts from multiple programs
• Parallel running using TestNg/JUnit
Automation Framework development in Agile testing
• Introduction to Frame W
This document provides an overview of test driven development (TDD), including what TDD is, an example unit test, the TDD process, benefits of TDD such as more maintainable code and fewer bugs, and resources for learning and practicing TDD such as books and training courses. TDD involves writing automated tests before implementation code to help ensure code quality and catch errors early. The process involves writing a test, seeing it fail, then writing just enough code to make it pass and refactoring as needed.
Behavior Driven Development—A Guide to Agile Practices by Josh EastmanQA or the Highway
The document discusses Behavior Driven Development (BDD) and how it can help increase quality and prepare an organization for increased business demands. It describes BDD as an industry practice where the whole team collaborates on system testing and definition of done. BDD promotes requirements using examples, collaboration between roles, finding defects earlier and more often through automation, and keeping technical debt low.
Similar to Test Driven Development Introduction (20)
2. Agenda
Introduction
Unit test overview
Refactoring
Test Driven Development approach
Q&A
3. Trainer’s profile
Over seven years experienced in software
industry on both product development and
out-sourcing.
Hand-over various positions from developers,
technical lead, project manager, technical
architecture and program/product managers.
4. Trainer’s profile (cont.)
Be experienced in managing small, medium
and large projects/program – Took oversight
more than 100 associates in one of the
biggest account in company
Be experienced on technical design,
technical management in various sizes of
projects from small to enterprise applications
on both desktop and web environment
5. Trainer’s profile
Be recognized as an Agile expert that has
experienced in managing Agile process,
applying Agile practices.
Maintain the blog that share experienced in
software development on both technical and
management areas (http://
www.haiphucnguyen.net/blog/)
7. Unit test - FAQs
Check the link for some common concerns of
applying unit test and its benefits:
http://www.haiphucnguyen.net/blog/?p=40
8. Unit test best practices
Keep test method as simple as possible:
DRY principle (Don’t repeat yourself)
–
Re-use test set up across test cases: put non-
–
trivial test data in test set up method
Clean test code as productive code
–
Evident data
All non-trivial methods must be passed unit
test with 100% coverage ratio.
9. Unit test best practices
Unit test independent with:
Other unit tests, order of unit test running
–
Environment (operating system, hardware
–
configuration, database …)
Fix broken test as soon as possible (it should
be immediately)
After fixing defect, write unit test to prevent it
re-occur
10. Unit test best practices
All test cases must be passed at the end of
working day.
Test project code, not library code
Minimal maintenance of test code
If you can not write unit test for some
functionality that means your code has
problem! Refactor it immediately
11. How to make code becomes testable
Using interface in communication among
layers, modules.
Dependency injection
Dependency lookup
Methods/Constructors has as less
parameters as possible (4 is the best
number)
12. How to make code becomes testable
Class is not depended in many other classes
-> it is hard to initiate instance of this class
One method has only one purpose
Be careful with singleton class or static
methods!
And the most important: refactoring your
code if it is not testable (esp. legacy code)
13. Refactoring
Refactoring is a disciplined technique for
restructuring an existing body of code,
altering its internal structure without changing
its external behavior. The system is also kept
fully working after each small refactoring,
reducing the chances that a system can get
seriously broken during the restructuring.
14. Refactoring (cont.)
Whenever you think you can make more
benefits with your new code:
Increase the re-usability
–
Make the code becomes testable
–
Avoid the rigid, fragile issues
–
Better performance
–
…
–
15. Refactoring – best practices
Keep small change running before proceed
another change.
Unit test should be written to make sure
refactoring does not change system’s
behaviors.
To legacy system: write test first, refactoring
and verify result
16. Test Driven Development
TDD is a technique to improve the quality of
both code and design. Developers will write
the test first, then writing the code to make it
pass the test. They can refactor code to
avoid issues (duplication or non-optimize
code …)
17. TDD benefits
Promoting high code coverage for productive
code.
Improving quality of architecture and code
Prevent defects cost is less than detect
defects cost
18. TDD Cycle
Prepare a list of test cases
Follow the TDD Rhythm:
Pick a test to implement
–
Write a fail test
–
Quickly make test green
–
Refactor to eliminate duplication
–
19. TDD – Things always do
Write test-first
Maintain to-do list
Writing new code only if there is failing
automated test
Run all tests all the time not only single
isolated test
20. TDD – Things always do
Job is done whenever complete
implementation and all test have green status
21. TDD – Things never do
Write test for trivial methods (such as
getters/setters)
Commit code with failed test
Big upfront design and code that makes test
first do not cover all cases of writing code
22. TDD best practices
Write the simple test first, then write code.
After that write test code for more complexity
functionality
Run test immediately whenever complete
writing code
If spending much time for writing code, break
the functionality into smaller ones and
applying TDD for these pieces
23. TDD best practices
Whenever test code or productive code
smells, refactor it immediately
After writing code, use coverage tool to make
sure productive code is covered 100% by
test method. If some piece of code is not
covered, your implementation has problem!
Use mock objects if needed
24. Tools support TDD
Various tools help developers easier to do
TDD:
IDE: Eclipse, MS Visual Studio Team System
–
Build tools: Ant, Maven, Nant
–
xUnit tools: Junit, TestNG, DBUnit, Nunit, …
–
Coverage tools: JCoverage, NCoverage
–
25. TDD examples
A user story of login page:
Presentation Layer: Login.html, Login.java
–
Service Layer: LoginService.java
–
Data Access Layer: LoginDAO.java
–
More complex user story: applying acegi for
authentication – authorization process:
Re-factor LoginService.java
–
Run test again
–
26. TDD examples (cont.)
Write the mock up html file: Login.html
Write test class: LoginTest.java
Write test method for case user login
success:
@Test
Public void testLoginSuccess() {
….
}
27. TDD examples (cont.)
Implement login function that pass the test
Void onSubmit() {
if (username.equals(“VietNam”)) {
setResponsePage(Helloworld.class);
}
else {
form.error(“Login fail”);
}
}
28. TDD examples (cont.)
Run LoginTest again and verify result (it has
green color)
Return the Login.java and add feature
verifying user base on database
Void onSubmit() {
if (userService.getUser(userName) != null) {
…
}
}
29. TDD examples (cont.)
The enterprise application that maintains the
suite of test cases and number of test cases
is growing daily:
Automation unit test
–
Continuous Integration
–
32. Q&A
Any question of unit test, refactoring and
TDD is welcome
33. Thank you
I hope you enjoy with this course. Any further
discussion, please contact me at
Email: hainguyen@esofthead.com
–
My blog: http://blog.esofthead.com
–