Smalltalk Testing - SUnit

Slides:



Advertisements
Similar presentations
Unit Testing Australian Development Centre Brisbane, Australia.
Advertisements

SPL/2010 Test-Driven Development (TDD) 1. SPL/
xUnit Test Patterns (Some) xUnit Test Patterns (in practice) by Adam Czepil.
J-Unit Framework.
What is Unit Testing? How TDD Works? Tsvyatko Konov Telerik Corporation
Test-Driven Development and Refactoring CPSC 315 – Programming Studio.
Smalltalk Connections 1 Test Driven Development (TDD) Presented by Victor Goldberg, Ph.D.
Unit and Functional Testing with JUnit and Related Tools Greg Barnes University of Washington
Well-behaved objects 4.0 Testing. 2 Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling Main concepts to.
Test-Driven Development and Refactoring Project 3 Lecture 1 CPSC 315 – Programming Studio Fall 2009.
Introduction to Eclipse, Unit Testing and JUnit David Rabinowitz.
JUnit. What is unit testing? A unit is the smallest testable part of an application. A unit test automatically verifies the correctness of the unit. There.
OOP #10: Correctness Fritz Henglein. Wrap-up: Types A type is a collection of objects with common behavior (operations and properties). (Abstract) types.
© S. Demeyer, S. Ducasse, O. Nierstrasz Chapter.1 Unit Testing Explained How to support changes? How to support basic but synchronized documentation?
George Blank University Lecturer. JUnit for Test Driven Development By Vivek Bhagat, George Blank.
Automated Testing Nathan Weiss April 23, Overview History of Testing Advantages to Automated Testing Types of Automated Testing Automated Testing.
Regression testing Tor Stållhane. What is regression testing – 1 Regression testing is testing done to check that a system update does not re- introduce.
Unit Testing Using PyUnit Monther Suboh Yazan Hamam Saddam Al-Mahasneh Miran Ahmad
By for Test Driven Development: Industry practice and teaching tool Robert Vanderwall, Ph.D. 1 WISTPC-15.
TDD,BDD and Unit Testing in Ruby
Lecture 6 Software Testing and jUnit CS140 Dick Steflik.
Introduction to Unit Testing Jun-Ru Chang 2012/05/03.
Or ways to enhance coding enjoyment, productivity and, most of all, preserve your sanity. Nicolas Connault Web developer Moodle HQ February 19 th 2008.
Testing in Extreme Programming
Unit and Functional Testing Your Flex Applications Mike Nimer Dir. Of Engineering nomee.com.
Programming By Intention/ Intro to JUnit. Admin ► Astels, p. 50 – “The test in the section titled Programming by Intention…” should read “The test in.
Sadegh Aliakbary Sharif University of Technology Spring 2012.
October, 2006 © Copyright 2006, Larry A. Beaty. Copying and distribution of this document is permitted in any medium, provided this notice is preserved.
Dr. Tom WayCSC Testing and Test-Driven Development CSC 4700 Software Engineering Based on Sommerville slides.
First BlueJ Day Houston, 2006 Unit Testing with BlueJ Bruce Quig Deakin University.
Well-behaved objects Main concepts to be covered Testing Debugging Test automation Writing for maintainability Objects First with Java - A Practical.
Introduction to JUnit 3.8 SEG 3203 Winter ‘07 Prepared By Samia Niamatullah.
Unit Testing with JUnit and Clover Based on material from: Daniel Amyot JUnit Web site.
JUnit Don Braffitt Updated: 10-Jun-2011.
Test Driven Development Daniel Brown dxb17u. Introduction Originates from Extreme Programming (XP) Proposed by Kent Beck in Test Driven Development.
Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 11, Testing.
1 Presentation Title Test-driven development (TDD) Overview David Wu.
JUnit. Introduction JUnit is an open source Java testing framework used to write and run repeatable tests JUnit is integrated with several IDEs, including.
S Ramakrishnan1 Systems V & V, Quality and Standards Dr Sita Ramakrishnan School CSSE Monash University.
Well-behaved objects Main concepts to be covered Testing Debugging Test automation Writing for maintainability Objects First with Java - A Practical.
Automated Testing in Sakai Testing applications and services in isolation and in context Josh Holtzman, UC Berkeley David Haines, University of Michigan.
Unit Testing with FlexUnit
13-Mar-16 Scalatest. Scalatest variants Scalatest is a testing framework inspired by JUnit Scalatest comes in various styles: FunSuite, FlatSpec, FunSpec,
Testing Unit Testing In Evergreen Kevin Beswick Laurentian University / Project Conifer.
REGRESSION TESTING Software Quality Engineering NC Zunaira Tariq Bese 19B Software Quality Engineering NC Zunaira Tariq Bese 19B.
Automated Testing with PHPUnit. How do you know your code works?
Software Engineering Lecture 11 Software Testing Presenter: Josef Hallberg 1.
Introduction to Unit Testing and JUnit David Rabinowitz.
Don Braffitt Updated: 26-Mar-2013
Unit Testing - solid fundamentals
Unit testing Java programs Using JUnit
Test Driven Development 1 November Agenda  What is TDD ?  Steps to start  Refactoring  TDD terminology  Benefits  JUnit  Mocktio  Continuous.
Software Testing.
Computer Science 209 Testing With JUnit.
Software Engineering 1, CS 355 Unit Testing with JUnit
Unit testing C# classes
Business Should Adopt Agile Testing. Test Driven Development is an essential software development way that is made by an automated test program which.
Test Driven Development
History, Characteristics and Frameworks
Introduction to Testing, SUnit and Error Handling
Test-driven development (TDD)
Testing and Test-Driven Development CSC 4700 Software Engineering
Chapter 11, Testing.
TDD & ATDD 1/15/2019.
Introduction to JUnit IT323 – Software Engineering II
Test Driven Development
Testing Acknowledgement: Original slides by Jory Denny.
Regression testing Tor Stållhane.
Test Driven Development
Software Testing Software Testing is a process of evaluating a system by manual or automatic means and verify that it satisfies specified requirements.
Presentation transcript:

Smalltalk Testing - SUnit Programming Languages HUJI 2010 Yardena Meymann

Testing Code needs to be tested Compilers are capable of checking some trivial errors, this is usually not enough Several types of tests exist: unit, functional, integration, performance, stress, smoke (a.k.a. sanity), … In a dynamically typed language, unit testing is integral part of the development

What are test for? Tests are an executable specification of the functionality that they cover, always synchronized with the code Tests increase the likelihood that the code is correct – finding bugs quickly TDD – writing tests first, improves interfaces - you see your code from the client’s point of view The presence of tests gives you the courage to make structural changes to the code: refactoring - essential to prevent creeping entropy

Test Driven Development When creating fresh code, introducing a feature or fixing a bug: first write tests see them fail write code that makes tests succeed see them pass re-run tests whenever code is changed (regression) keep tests passing, fixing code and refactoring tests if needed

Properties of Test repeatable run without human intervention act as a scenario stable - change frequency lower than the one of the covered functionality number of tests should be proportional to the number of tested functionalities

SUnit Introduction Minimal yet powerful framework “the mother of unit test frameworks” developed originally by Kent Beck SUnit allows to structure tests, describe the context of tests and to run them automatically

SUnit Simple test class extends TestCase setUp method – initialization (fixture) Methods that start with test Each method represent a single test Within methods use assert: condition or deny:condition Executing a test: MyTest run: #testMe Executing all tests: MyTest suite run Clean up with tearDown method

Example Test 'Sample-Test' SampleTest = TestCase ( | emptySet fullSet | 'as yet unclassified' setUp = ( emptySet := Set new. f ullSet := Set with: 5 with: #abc ) testIncludes = ( self assert: (fullSet includes: 5). self assert: (fullSet includes: #abc) testOccurrences = ( self assert: (emptySet occurrencesOf: 0) = 0. self assert: (fullSet occurrencesOf: 5) = 1. fullSet add: 5. self assert: (fullSet occurrencesOf: 5) = 1 testRemove = ( fullSet remove: 5. self assert: (fullSet includes: #abc). self deny: (fullSet includes: 5)

Hopscotch Test Runner

Hopscotch Test Runner