https://devsummit.aspirationtech.org/index.php?title=Delightful_Testing,_Joyful_Integration&feed=atom&action=historyDelightful Testing, Joyful Integration - Revision history2024-03-28T11:12:18ZRevision history for this page on the wikiMediaWiki 1.35.1https://devsummit.aspirationtech.org/index.php?title=Delightful_Testing,_Joyful_Integration&diff=199&oldid=prevVivian: 1 revision imported2015-05-05T17:21:39Z<p>1 revision imported</p>
<p><b>New page</b></p><div>'''[http://aspirationtech.org/files/TestingAndIntegrationPhoto.jpg Infographic of the Process]'''<br />
<br />
(Crummy first cut at the notes)<br />
<br />
Joyful testing/CI/Deployment<br />
<br />
Ben, David, Kathryn, Jack, Mike, David<br />
<br />
Brain dump: Theory of testing<br />
<br />
Existing project<br />
-> Integration tests: PHP: Beehat, Ruby: Rspec/feature specs<br />
Goes through your app like it's a user: create context/user, log in<br />
iOS: Instruments: lets you script device key presses<br />
end-to-end tests<br />
<br />
-> Unit tests: "test-driven development"<br />
Ben thinks it's fascist<br />
Isolated, break it down into a small piece of functionality<br />
<br />
Once you have tests - put them into Continuous Integration:<br />
Automatically run these tests when you commit code<br />
Example: Github<br />
Travis-CI.org - free for open source. A server that listens<br />
For private repos: CircleCI - not free for open source, but more affordable for private repos<br />
CircleCI if you have the budget, it's 2nd-gen, Travis-CI is 1st gen<br />
Hosted CI as a service<br />
<br />
It's joyful because you don't think about it<br />
<br />
CI will notify you, will identify who busted the code<br />
<br />
Continuous Deployment - push code now to your server<br />
OS 10 server xCode<br />
Travis now has Mac OSX build systems too<br />
<br />
You can write scripts to automate your deployment<br />
Scripts,<br />
e.g. for Drupal can do drush scripts<br />
<br />
Accountability and empowerment<br />
<br />
Watchers:<br />
In Ruby: Guard<br />
Sentry<br />
CodeKit<br />
Run from the command line<br />
Watches your code directory for changes, will run your unit tests<br />
Can rely on naming conventions<br />
<br />
Watchers run in your own development, not in the deployment process<br />
<br />
You don't have to think about it<br />
<br />
Q. When using Travis, so you have to use their baked-in deployment stuff or can you use<br />
Q. You can use your own scripts e.g. Fabric/ fab scripts<br />
<br />
Selenium, Phantom, Slimer (for Gecko), <br />
<br />
Q. Is there a middle ground between strict test-driven development<br />
A. Sometimes you have to ramp up while things are still in flux and you don't know how to test yet<br />
<br />
<br />
If you have Continuous Integration, there's test coverage<br />
Test coverage, static analysis<br />
Coveralls, Code Climate<br />
Metrics: How many lines of code, or % of functions covered<br />
It also reports which <br />
Python: Flake-8, Code smells, Style standard for Python is called Pep-8<br />
Code style, <br />
Duplicate functions - code smell<br />
<br />
The tools give you immediate feedback<br />
<br />
Software as a service $20/month - worth it<br />
<br />
Q. How about benchmarking/profiling<br />
A. Benchmarking<br />
New Relic - free for a lot of stuff, but just spend the freaking money<br />
Airbrake - 1st gen, Sentry - 2nd gen<br />
<br />
iOS - Criticism<br />
If your website throws an error it will email you<br />
Will give you an initial email notice, plus a digest<br />
<br />
Logger/logging - most useful for 404s<br />
<br />
Q. How do you justify/estimate the effort and get buy-in?<br />
A. Lie to them<br />
You can pay a heavy penalty - lose 100k signups, mission critical<br />
Scare tactics - not working<br />
<br />
Heroku<br />
No direct push deployment - always push through these tools<br />
<br />
Assertion layer<br />
<br />
Q. How to do integration testing when 3rd-party services are involved (Facebook, donation processors)<br />
A. Create multiple accounts - 4x as many - use tokens/environment variables, fake CC numbers (but not all services do this - Global Collect)<br />
<br />
Q. ActionKit testing client-side, JS stuff<br />
Liquid for templating?<br />
Django<br />
A. Also do API call afterwards, to check if the data got written back to DB<br />
<br />
Week-long sprint approach - break<br />
<br />
Puppet - to set up a new server</div>Vivian