510 likes | 647 Views
Testing Tools in Alfresco. About me Fran Álvarez Zaizi Iberia Director Keywords: ECM, Information retrieval, testing, semantic technologies T witter: @fran7alvarez Email: falvarez@zaizi.com Skype: fjalvarezb.
E N D
About me • Fran Álvarez • Zaizi Iberia Director • Keywords: ECM, Information retrieval, testing, semantic technologies Twitter: @fran7alvarez Email: falvarez@zaizi.com Skype: fjalvarezb
WARNINGThis presentation may contain technical contentManager discretion is advised
Index • Testing concept • Zaizi testing stack • Challenges • Ecosystem • Continous Testing • Advice • Evolution • TDD in Alfresco • Conclusions
What is ‘Test’ A test is an assessment intended to measure a test-taker’sknowledge, skill, aptitude, physical fitness or classification in many other topics.
Test in Software Software testing is an investigation conducted to provide stakeholders with information about the quality of the product or service under test.
Our measurement (aka Metrics) • How well our code works • How ‘well coded’ our code is • How good our tests are • How well the requirements are met • How well our features responds to massively requests
Our assessment • Different ways to measure: • Border Line • 100%-0% • Acceptance criteria definition • Example: • 100% UT, 95% FT, 70% CC
The importance of testing • Testing means: • In architecture: • The building where I live is not going to fall down • In aeronautics: • The plane where I’m traveling is not going to fall down • In food industries: • The food you are having is not going to cause you pain Have I convinced you yet?
The difficulty of testing • Other tested subjects know their ‘environment’
The difficulty of testing (II) • In Software Engineering we may have: • Code run in different servers • Race conditions • Performance issues • Code is integrated with 3rd parties • 3rd parties changed • 3rd parties might not be available • Requirements change after placed in production …
Thedifficulty of testing (III) • Itwasnevereasytoproperly test Don’t waste your time testing! We need to get more profit from the project
Scenario • Lots of features • Long durationproject • Severalcomponents: • API • Behaviours • Out-of-the-box customizations • Hugepermissioncomplexity • 3rd partyintegrations • Etc
The ZAIZI TestingEcosystem Codingdoesnotendwithinthecode
The ZAIZI Testing Ecosystem • Perform unit tests for each piece of code • Mock 3rd parties or subsystems • Create reports for code covering and code health • Create harnesses for APIs • Mimic user operations for functional tests • Create report for multiuser and multithread testing • And more…
The ZAIZI TestingEcosystem : Maven • Thefoundations • Full lifecyclemanagement • DeliverAlfrescocode in anyformat • War, AMP, Jar, RPM • Integratesomeusefulplugins • Surefire • Cobertura • Sonar
The ZAIZI TestingEcosystem : jUnit • Unittests • Mavensurefireintegration • Virtual Alfrescocontext • Cleanrunevery time • Databasewiping • Doesnotgeneratethepackageifsome test fails
The ZAIZI Testing Ecosystem : Mockito • Mimic components, 3rd parties • Very useful to isolate your code • Just test what’s yours
The ZAIZI TestingEcosystem : Sonar • Open Sourcecodequalityplatform • Weusedfor: • Checkhowcomplexthecodeis • Cyclomaticcomplexity • Checkthestyle of thecode • Variable/Methodsnames • Codecoverage • Analternativefor cobertura
The ZAIZI TestingEcosystem : Cobertura (II) • Line coverageacceptable • Branchcoveringnotenough
The ZAIZI TestingEcosystem :JMeter • Central axis • Runningservicesautomatically • HTTP: Webscripts • SMTP: Emails • Etc • Usedforcreating test suites: • API harnesses • Emulateusers • Massiverequests
The ZAIZI TestingEcosystem : JMeter (III) • Test harnesspurposes: • Catalog of operations • Practicalexamples • Inputs, outputs • Checkunexpectedchangesvisually
The ZAIZI TestingEcosystem : JMeter (IV) • Functional test purposes • Collecting use cases • Emulatingthem • Checkingthe response istheoneexpected
The ZAIZI TestingEcosystem : JMeter (V) • Performance test purposes • Basic operationsexecutedseveral times • Severalthreads, severalusers • Reportsfor diagnosis • CombinedwithAppdynamics
The ZAIZI TestingEcosystem : Confluence • Usedforuploadingreports
The ZAIZI TestingEcosystem : Confluence • Checksevery single jMeteroperation
The ZAIZI TestingEcosystem : AppDynamics • Usedforchecking and montoringthe performance of theapplications in theenvironments • Detectslowtransactions, memoryleaks, etc • Hugeamount of options and configurations • Could be talkingaboutitforhours
AutomatedContinousTesting • Testingwithout human involvement • Dedicated server fortestingpurpose • Continousdeploymentpurpose • Configurationsclosetoproduction • Repeatable, robust, auditable Again, thankstothecustomer!!
AutomatedContinousTesting • Notanymore!!
Don’t become a test-addict • Don’t ‘all-in’ if you don’t need it • Meet your requirements, do your testing Leverage your code with testing, not the opposite!
Evolutioningtheecosystem • Makingfunctionaltests more functional • Detectingsomebehaviorswithinthe log files
Ecosystem 2.0: Splunk • Monitor Alfresco logs with ‘live’ tests • Detect unexpected outputs • Alert unexpected behaviour “Would you like to know more?”
Ecosystem 2.0: Selenium • Limitationswith JMeter in Share • Asynchronouscalls are notcatchedproperly • Seleniumisperfecttoemulateuser&browserinteraction
TDD in Alfresco • Test DrivenDevelopment • Simple software developmenttechnique • Short developmentcycles • Focusedondeliverwhatisrequired, nothingelse
TDD in Alfresco • PossiblethankstoAlfresco and Maven-Surefireintegration • Virtual Database and Alfrescocontext
TDD in Alfresco • Benefits • You focus on delivering, not coding for coding • Coding behaviors, not just code • Tests are really part of documentation • Debug actual code from tests • Usually less number of defects • Inconvenients • Tests are slow – Alfresco context starting up • Not prepared to test UI
Cost Savings • Time saving • Validation could take more than 3 hours • Create, check, delete… • Project duration might be 2+ years • Do you need a calculator? • Reducing development cycle • Moral savings • Testing the same everyday is frustrating • You don’t test the very same twice • Cost effective testing • You only test when something went wrong
Conclusions • Testing is a good QA indicator • Not conform yourself with Unit tests • Build a stack to fully test your apps • You will save time and frustations • Don’t become crazy by testing
Credits (or thanks, thanks, thanks) • Trafigura • Michael Phan – Technical Architect • James Bennett – Head of QA • Ian Carr – Project Manager