This is the talk that I gave at JSConf.eu 2009, then modified slightly and given again at the December Bayjax meetup (the parts on jQuery and HTML 5 in IE were added).
Ein Talk über gute und schlechte Tests in der Softwareentwicklung. Basierend auf dem Werk "Bad Tests, Good Tests" von Tomek Kaczanowski
Verlag: kaczanowscy.pl Tomasz Kaczanowski (11. Dezember 2013)
Sprache: Englisch
ISBN-10: 8393847133
Christof Vollrate (BILD GmbH & Co. KG)
Ein Talk über gute und schlechte Tests in der Softwareentwicklung. Basierend auf dem Werk "Bad Tests, Good Tests" von Tomek Kaczanowski
Verlag: kaczanowscy.pl Tomasz Kaczanowski (11. Dezember 2013)
Sprache: Englisch
ISBN-10: 8393847133
Christof Vollrate (BILD GmbH & Co. KG)
Step by step introduction to get unit testing, UI testing, mocking and continuous integration up and running for your Swift projects. These slides are from Agile Swift Meetup in Montreal.
A presentation on JUnit Pioneer given at Fortitude Technologies on Mar. 4, 2021. JUnit Pioneer is an extension library for JUnit 5 (Jupiter).
Sample code on GitHub at:
https://github.com/sleberknight/junit-pioneering-presentation-code
JUnit Pioneer home page:
https://junit-pioneer.org
This presentation by Oleksandr Navka (Lead Software Engineer, Consultant, GlobalLogic, Kyiv) was delivered at GlobalLogic Kharkiv Java Conference 2019 on June 9, 2019.
He spoke of the “testing pyramid”, helpful test-writing tools that were introduced or updated recently, and test environment management — namely, about JUnit 5, Spring testing, REST Assured, Database rider, and Test containers.
Video: https://youtu.be/UXqxQPD84pc
From typing the test to testing the typeWim Godden
PHP unit testing + new PHPUnit patch for type testing functionality
Seems bullet points are not working and some of the slides are not so clear because of Slideshare conversion.
Presentation given at phpBenelux meeting August 25, 2010
An overview how to realize code generation of languages on the JVM that implement other class layouts than the Java programming languages. As an example, the inline-mock-maker for Mockito is discussed which supports languages like Kotlin that make any property final by default.
Step by step introduction to get unit testing, UI testing, mocking and continuous integration up and running for your Swift projects. These slides are from Agile Swift Meetup in Montreal.
A presentation on JUnit Pioneer given at Fortitude Technologies on Mar. 4, 2021. JUnit Pioneer is an extension library for JUnit 5 (Jupiter).
Sample code on GitHub at:
https://github.com/sleberknight/junit-pioneering-presentation-code
JUnit Pioneer home page:
https://junit-pioneer.org
This presentation by Oleksandr Navka (Lead Software Engineer, Consultant, GlobalLogic, Kyiv) was delivered at GlobalLogic Kharkiv Java Conference 2019 on June 9, 2019.
He spoke of the “testing pyramid”, helpful test-writing tools that were introduced or updated recently, and test environment management — namely, about JUnit 5, Spring testing, REST Assured, Database rider, and Test containers.
Video: https://youtu.be/UXqxQPD84pc
From typing the test to testing the typeWim Godden
PHP unit testing + new PHPUnit patch for type testing functionality
Seems bullet points are not working and some of the slides are not so clear because of Slideshare conversion.
Presentation given at phpBenelux meeting August 25, 2010
An overview how to realize code generation of languages on the JVM that implement other class layouts than the Java programming languages. As an example, the inline-mock-maker for Mockito is discussed which supports languages like Kotlin that make any property final by default.
Evidence is a new, framework-agnostic unit testing library which I developed out of necessity and frustration with the existing offering. Although it's heavily inspired by it's Ruby, Python and Java couterparts, Evidence is packed with niceness targeted at the specificities of the JavaScript language and its different environments. Hopefully this introduction to Evidence will give you the motivation, tools and knowledge to start unit testing your JavaScript code if you are not doing so already.
Slides from my Confitura 2012 presentation. The issues discussed during the talk will be described in my new (free!) ebook - see https://github.com/tomekkaczanowski/bad-tests-good-tests
Unit Testing Front End JavaScript
with Yuri Takhteyev
Presented on September 18 2014 at
FITC's Web Unleashed Toronto 2014 Conference
More info at www.fitc.ca
Building complex software application can be made much easier with unit testing – a fact well established in back-end work but often overlooked on the front-end. Yuri Takhteyev will look at some of the tools and techniques for unit testing front end code, focusing on Mocha and Karma. Most of the examples will draw on AngularJS but the main ideas are applicable to other frameworks as well.
OBJECTIVE
Learn how to write unit tests for front-end code.
TARGET AUDIENCE
Front-end JavaScript developers not currently using unit testing or those experiencing difficulties with unit testing.
ASSUMED AUDIENCE KNOWLEDGE
Intermediate front-end JavaScript, no prior experience with front-end unit testing
FIVE THINGS AUDIENCE MEMBERS WILL LEARN
How unit testing benefits the developer
How to structure applications to make them testable
How to use Mocha and Karma in unit testing
How to mock dependencies (and why)
How to handle asynchronous code
Quality assurance and testing are very important in a life cycle of any application. Although, by far not all developers understand the significance of tests.
In this presentation, we cover the basic testing practices for developers. The following tools are discussed: JUnit, Mockito, Hamcrest, JsTestDriver, DBUnit, Arquillian, SoapUI, Selenium.
If you don’t test it, how do you know it works? Over the past few years, we have been compelled to write unit and integration tests for our applications--code that validates code--and it is these tests that change a one-off tool into a well-architected, robust, business-ready application. Yet, every new framework requires a new testing framework, so in this session, we will discuss testing frameworks for node.js. You will walk away with a solid understanding of how to write tests against your node.js applications and modules, leading to confidence that your work is business-ready.
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
14. Unit Testing
✦ Break code into logical chucks for testing.
✦ Focus on one method at a time.
✦ Good for testing APIs.
✦ Popular Frameworks:
✦ QUnit
✦ JSUnit
✦ YUITest
✦ FireUnit
15. JSUnit
✦ One of the oldest JavaScript testing
frameworks.
✦ A port of JUnit to JavaScript, circa 2001.
✦ Code feels very 2001 (frames!)
✦ http://www.jsunit.net/
16. JSUnit
function coreSuite() {
var result = new top.jsUnitTestSuite();
result.addTestPage("tests/jsUnitAssertionTests.html");
result.addTestPage("tests/jsUnitSetUpTearDownTests.html");
result.addTestPage("tests/jsUnitRestoredHTMLDivTests.html");
result.addTestPage("tests/jsUnitFrameworkUtilityTests.html");
result.addTestPage("tests/jsUnitOnLoadTests.html");
result.addTestPage("tests/jsUnitUtilityTests.html");
return result;
}
function serverSuite() {
var result = new top.jsUnitTestSuite();
result.addTestPage("tests/server/jsUnitVersionCheckTests.html");
result.addTestPage("tests/server/jsUnitServerAjaxTests.html");
return result;
}
function librariesSuite() {
var result = new top.jsUnitTestSuite();
result.addTestPage("tests/jsUnitMockTimeoutTest.html");
return result;
}
function suite() {
var newsuite = new top.jsUnitTestSuite();
newsuite.addTestSuite(coreSuite());
newsuite.addTestSuite(serverSuite());
newsuite.addTestSuite(librariesSuite());
return newsuite;
}
17. JSUnit
function testAssertNotUndefined() {
assertNotUndefined("1 should not be undefined", 1);
assertNotUndefined(1);
}
function testAssertNaN() {
assertNaN("a string should not be a number", "string");
assertNaN("string");
}
function testAssertNotNaN() {
assertNotNaN("1 should not be not a number", 1);
assertNotNaN(1);
}
function testFail() {
var excep = null;
try {
fail("Failure message");
} catch (e) {
excep = e;
}
assertJsUnitException("fail(string) should throw a JsUnitException", excep);
}
function testTooFewArguments() {
var excep = null;
try {
assert();
} catch (e1) {
excep = e1;
}
assertNonJsUnitException("Calling an assertion function with too
few arguments should throw an exception", excep);
}
19. YUITest (2 & 3)
✦ Testing framework built and developed by
Yahoo (released Oct 2008).
✦ Completely overhauled to go with YUI v3.
✦ Features:
✦ Supports async tests.
✦ Has good event simulation.
✦ v2: http://developer.yahoo.com/yui/
examples/yuitest/
✦ v3: http://developer.yahoo.com/yui/3/test/
20. YUITest 2
YAHOO.example.yuitest.ArrayTestCase = new YAHOO.tool.TestCase({
name : "Array Tests",
setUp : function () {
this.data = [0,1,2,3,4]
},
tearDown : function () {
delete this.data;
},
testPop : function () {
var Assert = YAHOO.util.Assert;
var value = this.data.pop();
Assert.areEqual(4, this.data.length);
Assert.areEqual(4, value);
},
testPush : function () {
var Assert = YAHOO.util.Assert;
this.data.push(5);
Assert.areEqual(6, this.data.length);
Assert.areEqual(5, this.data[5]);
}
});
24. QUnit
✦ Unit Testing framework built for jQuery.
✦ Features:
✦ Supports asynchronous testing.
✦ Can break code into modules.
✦ Supports test timeouts.
✦ No dependencies.
✦ Painfully simple.
✦ http://docs.jquery.com/QUnit
25. QUnit Style
test("a basic test example", function() {
ok( true, "this test is fine" );
var value = "hello";
equals( "hello", value, "We expect value to be hello" );
});
module("Module A");
test("first test within module", function() {
ok( true, "all pass" );
});
test("second test within module", function() {
ok( true, "all pass" );
});
module("Module B");
test("some other test", function() {
expect(2);
equals( true, false, "failing test" );
equals( true, true, "passing test" );
});
27. FireUnit
✦ Unit testing extension for Firebug
✦ fireunit.ok( true, “...” );
✦ http://fireunit.org/
28. Standardization
✦ CommonJS: A unified cross-platform API
for JavaScript.
✦ (Including the server-side!)
✦ Working to standardize a simple testing
API.
✦ http://wiki.commonjs.org/wiki/CommonJS
29. Server-Side
✦ Ignore the browser! Simulate it on the
server-side.
✦ Almost always uses Java + Rhino to
construct a browser.
✦ Some frameworks:
✦ Crosscheck
✦ Env.js
✦ Blueridge
30. Server-Side
✦ Crosscheck
✦ Pure Java, even simulates browser bugs.
✦ http://www.thefrontside.net/crosscheck
✦ Env.js
✦ Pure JavaScript, focuses on standards
support.
✦ http://github.com/thatcher/env-js/tree/
master
✦ Blueridge
✦ Env.js + Screw.Unit + Rhino
✦ http://github.com/relevance/blue-ridge/
34. Distributed
✦ Selenium Grid
✦ Push Selenium tests out to many
machines (that you manage),
simultaneously.
✦ Collect and store the results.
✦ http://selenium-grid.seleniumhq.org/
✦ TestSwarm
✦ Push tests to a distributed swarm of
clients.
✦ Results viewable on the server.
✦ http://testswarm.com/
35. The Scaling Problem
✦ The Problem:
✦ jQuery has 6 test suites
✦ Run in 15 browsers
✦ (Not even including multiple platforms
or mobile browsers!)
✦ All need to be run for every commit,
patch, and plugin.
✦ JavaScript testing doesn’t scale well.
36. Distributed Testing
✦ Hub server
✦ Clients connect and help run tests
✦ A simple JavaScript client that can be run
in all browsers
✦ Including mobile browsers!
✦ TestSwarm
37. FF 3.5 FF 3.5 FF 3.5
IE 6
IE 6
FF 3 IE 6
Op 9
FF 3
IE 7
TestSwarm
IE 7
Test Suite Test Suite Test Suite
38.
39.
40.
41. TestSwarm.com
✦ Incentives for top testers (t-shirts, books)
✦ Will be opening for alpha testing very soon
✦ Help your favorite JavaScript library
become better tested!
✦ http://testswarm.com
43. Major Cases
✦ Same Code, Different Platforms
✦ Compare V8 vs. SpiderMonkey vs.
JavaScriptCore
✦ Different Code, Same Platform
✦ Compare CSS Selector Engines
✦ A/B testing a piece of code
44. Same Code, Different Platform
✦ A number of suites analyzing JS perf:
✦ SunSpider (from WebKit)
✦ V8 Benchmark (from V8/Chrome)
✦ Dromaeo (from Mozilla)
✦ Statistical accuracy and reproducibility is
paramount.
45. SunSpider
✦ All tests were highly balanced.
✦ Provide some level of statistical accuracy.
✦ +/- 5ms (for example)
✦ Tests are run by loading an iframe with the
test 5 times.
✦ getTime() is run before/after each test.
✦ Entire suite must be trashed in order to
upgrade/fix a test.
46. Error Rate?
✦ How do we get it? What does it mean?
✦ It’s how confident we are that we arrived
at the result we want in the number of
runs that we’ve done.
47. Normal Distribution
✦ First: Assume that the results are coming
back in a normal distribution.
✦ The “bell curve”
48.
49. Confidence
✦ Next: We need a confidence level.
✦ T-Distribution works well here.
http://en.wikipedia.org/wiki/Student%27s_t-distribution
50. Error Rate
✦ 5 runs
✦ (each run is potentially 1000s of
individual test runs)
✦ 95% Confidence (t-distribution = 2.776)
✦ Standard Errors Mean =
✦ (std_dev / sqrt(runs)) * 2.776
✦ Error = (err_mean / mean) * 100
✦ This way you can get results like:
✦ 123ms +/- 5ms
51. V8 Benchmark
✦ Tests are run, potentially, 1000s of times.
✦ Also provides an error rate.
✦ (Use a geometric mean to arrive at a
result.)
52. Small Time Accuracy
✦ Small time:
✦ 1ms, 1ms, 1ms, 1ms, 3ms
✦ huge error!
✦ Large time:
✦ 1234ms, 1234ms, 1234ms, 1234ms, 1238ms
✦ tiny error!
✦ Tests that run faster need to be run more
times.
✦ Running more times = less potential for
weird results.
http://ejohn.org/blog/javascript-benchmark-quality/
53.
54.
55. Runs/Second
✦ var start = (new Date).getTime();
while (time < 1000) {
runTest();
time = (new Date).getTime() - start;
}
✦ More test runs, more statistical accuracy.
✦ V8 & Dromaeo-style suites handle this.
✦ (Problem: getTime() is being run on every
loop - it should be run less frequently in
order to influence the numbers less.)
56. Runs/Second
✦ You are now measuring tests/second rather
than seconds per test.
✦ You run tests as many times in one second
as you can.
✦ Then you do that multiple times (5?)
✦ THEN you analyze the final numbers:
✦ 1234run/s, 1230runs/s, 1240runs/s, ...
57. Harmonic Mean
✦ A way to average rates
✦ Which is what we have! runs/second
✦ For example:
✦ 1234run/s, 1230runs/s, 1240runs/s,
1236runs/ms, 1232runs/s
✦ 5 / ( (1/1234) + (1/1230) + (1/1240) + (1/1236)
+ (1/1232) ) =
✦ 1234.39runs/s!
http://en.wikipedia.org/wiki/Harmonic_mean
58. Dromaeo
✦ All individual tests are versioned
✦ Makes it easy to update or fix a bug in a
test
✦ Can only run tests of specific versions
against each other
✦ Uses V8’s style of running tests.
✦ Also has DOM and framework tests.
✦ ...and hooks for doing Shark profiling.
59. Bug Fixes
✦ Tests will, inevitably, have bugs that need
to be fixed.
✦ Fixing a bug changes the result quality.
✦ Tests need to be versioned so that changes
can be made.
✦ You look at Test v1 vs. Test v1 results.
✦ Not Test v2 vs. Test v1.
✦ Tip: Just use the last revision control
commit # for the test file.
60. Different Code, Same Platform
✦ Most solutions here are very poor.
✦ Run the test very few times, use getTime().
✦ Highly inaccurate results, massive error.
61. Garbage Collection
✦ Browsers periodically run garbage
collectors to clean up old objects no longer
referenced.
✦ This can take a long time and spike your
test results.
✦ Example:
✦ 10ms, 13ms, 11ms, 12ms, 486ms, 12ms, ...
✦ When comparing engine to engine, this
doesn’t matter.
✦ Comparing code vs. code, it does.
62. Mean, Median, Mode?
✦ Mode!
✦ Run your tests a large number of times.
✦ What is the ‘mode’ (the result that
occurs most frequently)
✦ Example:
✦ 10, 11, 11, 12, 12, 12, 13, 14
✦ Mode = 12ms.
✦ Less accurate than mean, but gives you a
more-consistent result.
✦ DON’T DISCARD “BAD” RESULTS!
68. IE in Wine
✦ Running Internet Explorer in Wine (on
Linux) gives fine-grained timer results
✦ Down to the millisecond!
✦ You can also run IE, in Wine, on OS X:
✦ ies4osx
✦ Huge Caveat: It gives you fine-grained
time, but that doesn’t mean it’s accurate.
69.
70. Different Code, Same Platform
✦ How can we get good numbers?
✦ We have to go straight to the source: Use
the tools the browsers provide.
76. Shark Profiling
✦ Extremely low-level
✦ Watch for all internal function calls
✦ See what gets called the most.
✦ Dromaeo includes shark profiling hooks.