• No results found

What the heck is that bar over there?

N/A
N/A
Protected

Academic year: 2021

Share "What the heck is that bar over there?"

Copied!
49
0
0

Loading.... (view fulltext now)

Full text

(1)
(2)
(3)
(4)
(5)
(6)
(7)
(8)

i. Some real-life besserwissening

ii. Technology 1: Selenium for web-testing

iii. Technology 2: Hudson for Continous Integration

(9)

thomafni

MSc from ifi spring 2006 inf5750 spring 2005

Blog here: http://tfnico.blogspot.com

(10)

hisp.info

svn co http://www.hisp.info/svn/trunk/dhis-2/ mvn install

building... ...lotsa deps tests are running.. ... and running... oi, a test failure! : Failed tests:

testExport(org.hisp.dhis.importexport.ixf.IXFExportServiceTest) jaja, -Dmaven.test.skip=true

still on webwork 2.2.6? tsk, tsk, well so are we anyway mvn eclipse:eclipse and import into Eclipse..

(11)

Active mailing listsImproved Wiki

Code looks niceAn active TracDemo up!

(12)
(13)

BEAUTIFUL! Well done.

(14)
(15)
(16)

*Disclaimer:

This presentation was originally made for Storebrand developers (in Norwegian).

(17)

Warmup

Web developers?Tried..JUnitFIT(nesse)WatirSelenium

(18)

A trip down memory lane

January: Selenium is released

Quickly gains attention through conferences, articles, etc

(19)

A trip down memory lane

October: Storebrand starts using Selenium tests

• Verifying use-cases • Regression testing

• Basis for performance tests

(20)

A trip down memory lane

Selenium development hibernation (only 1 release)

November/December: Storebrand’s tests are freshed up

(21)

A trip down memory lane

Storebrand still runs Selenium tests

Selenium popularity increases (1.0 beta released)

2008

”Google has 51k Selenium tests running accross 50 different teams”

(22)

Why test?

People are slow! Tests can be automated (and monitored) Errors in existing code introduced

(regression_tests) Verify functionality (use-cases) Handy for debugging

(23)

Why test web?

Some things you can’t test with JUnit (easily)

JSP

HTML/Web-designJavaScript

Navigation/urls (struts.xml)

(24)

Some architecture

Web

JSP JSP JSP JSP

Controller Controller Controller Controller

(25)

Some test architecture

Web

JSP JSP JSP JSP

Controller Controller Controller Controller

Service Service

JUnit JUnit JUnit ?

(26)

Web-testing tools

Pros Cons Selenium (JS-engine) Can test JS Good Recorder Browser dependant Watir (Ruby) Powerful language Runs native IE New language Browser dependant HtmlUnit (Java) Mature

Virtual browser buffer

(27)

Selenium

Selenium IDE (Firefox plugin)Selenium Core

Remote Control

(28)

Good things about Selenium

Active community

Scaringly easy

(29)

A normal day in the

web-testers life

Do a quick demo on local DHIS2(Or on the demo site)

(30)

maven-selenium-plugin

take it for a spin

(31)

What can go wrong

Too much time

Too much ”dill”

Tests break without anything being wrong

(dialog boxes, browser upgrades)

Too many tests

Too long, slow tests

(32)

Remedies

Use it, and get helpGood urls, good id’sTest suites:

(33)

Don’t test these

Performance (unøyaktig måling)Data (too static)

Business rules (imprecise)Integration (too slow)

(34)

More tips

Push tests ”downward”Be pragmatic

Don’t test everything with Web/GUI-testsHave a strategy

Make bugreporters record traces when they report errors

Web

JSP JSP JSP JSP

Controller Controller Controller Controller

Service Service JUnit

JUnit JUnit ?

(35)

Testing Strategies

Selenium? --- Fit?

--- TestNG?

(36)

---Testing Strategies

Selenium? --- Fit? --- TestNG? --- JUnit? ---No data Data No

environment Environment Location

Unit test Fast (1-5) n/a Fast (1-5) n/a

Service test Fast (1-5) Slow (2-5) Fast (1-5) Slow (2-5)

System test Slow

(37)
(38)

Questions to you

Should we run clean install before every

commit?

(39)

Continous Integration

Don’t run the tests yourself

(40)

Take it for a spin

Show off hudson locally

(41)

Continous Integration

Let the machines do the testing

Earliest possible feedback!The build is broke!

What’s broken?Who broke it?

(42)

Continous Integration

Continuum (from the Maven lads)Hudson (Koshuke, the devil)

CruiseControl (good old)Bamboo (Atlassian)

(43)

Things to consider

One product, one build?

(you could build site..)

Lots of different things to testMany testing frequencies

Each commitHourly

(44)

My advice

For every combination (you want to do)Make a job: build goal plus frequency

2 minute build10 minute builddatabase-integration testsweb-testsevery-2-hour-integration testsnightly site/snapshot

(45)

Broken or unstable?

Is it broken if only 1 test doesn’t run?

What does broken mean?

Is that test releavant to all the other modules?

(46)

Broken or unstable?

Make the CI see the difference

Hudson and Bamboo shows new test-failuresYellow versus green builds

(47)

Conclusion

Today:

Install Selenium IDE

Next weeks:

Maintain a handful of tests

When/if you learn to love them

(48)
(49)

References

Related documents

Almost every country in the world today is connected to an internet but there are challenges in making firm legislations for dealing with e- evidence , e-contract and

Determine which encryption cipher is used for the database on the Android, BlackBerry and iPhone operating system in the first week of the project?. 2.3.2 How strong is

In this section some selected simulation experiments with the ES-MCM block are reported to illustrate the main properties of the empirical model. As in the theoretical analysis

Moreover, four of five employers providing these graduates with the greatest number of opportunities (insurance, man- agement consulting, computer systems design, and manufacturing)

Six validated tools were used to screen for the full range of mental health disorders including developmental disorders like Personality Disorder, Attention Deficit

2.1 Classification of materials 9 2.2 Types of reinforce phase in composite 10 2.3 Components of composite materials 10 2.4 Molecule chain of polymer 12 2.5 Chemical group of

As mentioned earlier, one of the biggest surprises in the aftermath of Hurricane Sandy was the extensive and effective use of social media and digital tools to share information

Section 6.01 of the Agreements, Blue Sphere is entitled to receive $1,071,250 (the “Mechanical Completion Payment”), consisting of $587,500 related to the NC Facility and