A talk about unit testing for iOS apps. Part rambling introduction to test driven development, part examples of certain types of tests for iOS, and a brief mention of writing your tests using Kiwi.
Lightening Talk I gave at Inaka in April 2014.
I was in charge of investigating test-driven development for our iOS mobile team. Since I realized it was such a big concept, after having gathered enough information and having played with it enough, I decided to introduce my fellows on the topic by presenting it in a formal talk with slides. The aim was teaching them a different way of developing, which, for us, at that moment, was completely new and controversial.
Given that the database, as the canonical repository of data, is the most important part of many applications, why is it that we don't write database unit tests? This talk promotes the practice of implementing tests to directly test the schema, storage, and functionality of databases.
Practical tips for dealing with projects involving legacy code. Covers investigating past projects, static analysis of existing code, and methods for changing legacy code.
Presented at PHP Benelux '10
Lightening Talk I gave at Inaka in April 2014.
I was in charge of investigating test-driven development for our iOS mobile team. Since I realized it was such a big concept, after having gathered enough information and having played with it enough, I decided to introduce my fellows on the topic by presenting it in a formal talk with slides. The aim was teaching them a different way of developing, which, for us, at that moment, was completely new and controversial.
Given that the database, as the canonical repository of data, is the most important part of many applications, why is it that we don't write database unit tests? This talk promotes the practice of implementing tests to directly test the schema, storage, and functionality of databases.
Practical tips for dealing with projects involving legacy code. Covers investigating past projects, static analysis of existing code, and methods for changing legacy code.
Presented at PHP Benelux '10
Unit testing helps improving the quality of your code and greatly simplifies dealing with complex code. The testing framework of choice for React.js is Jest.
Unit testing and test-driven development are practices that makes it easy and efficient to create well-structured and well-working code. However, many software projects didn't create unit tests from the beginning.
In this presentation I will show a test automation strategy that works well for legacy code, and how to implement such a strategy on a project. The strategy focuses on characterization tests and refactoring, and the slides contain a detailed example of how to carry through a major refactoring in many tiny steps
KiwiPyCon2011, Wellington, Sunday, Track 1, Automated testing in Python and beyond by Brenda Wallace, Open source hacker @ Weta Digital. Python libraries and extensions. A short intro to unitest and why they are so good for you.
Overview of python unittests and nose, and comparison to popular unittesting frame works in other languages, including perl, php, ruby, java, scala, erlang.
The presentation contains a definition and survey of the benefits of Unit Testing, and a little coding example to get the feeling of Unit Testing using JUnit, EasyMock and XMLUnit.
This is a talk Jonny Schneider and I gave as part of the Thoughtworks Quarterly Technology Briefing, on various aspects of mobile strategy and delivery.
Unit testing helps improving the quality of your code and greatly simplifies dealing with complex code. The testing framework of choice for React.js is Jest.
Unit testing and test-driven development are practices that makes it easy and efficient to create well-structured and well-working code. However, many software projects didn't create unit tests from the beginning.
In this presentation I will show a test automation strategy that works well for legacy code, and how to implement such a strategy on a project. The strategy focuses on characterization tests and refactoring, and the slides contain a detailed example of how to carry through a major refactoring in many tiny steps
KiwiPyCon2011, Wellington, Sunday, Track 1, Automated testing in Python and beyond by Brenda Wallace, Open source hacker @ Weta Digital. Python libraries and extensions. A short intro to unitest and why they are so good for you.
Overview of python unittests and nose, and comparison to popular unittesting frame works in other languages, including perl, php, ruby, java, scala, erlang.
The presentation contains a definition and survey of the benefits of Unit Testing, and a little coding example to get the feeling of Unit Testing using JUnit, EasyMock and XMLUnit.
This is a talk Jonny Schneider and I gave as part of the Thoughtworks Quarterly Technology Briefing, on various aspects of mobile strategy and delivery.
Building mobile teams and getting a product to marketsgleadow
Rich Durnall and I presented our experience building apps with REA Group (who run the popular realestate.com.au website). The main focus was on how agile software development fits with mobile, with an emphasis on small, lean teams that iterate and learn quickly.
Make testing easier and more productive by applying test-driven development strategies to the world of iOS and Objective-C. Join us to learn about the tools that are available, and hear strategies for writing more testable code and robust tests. You'll be ready to take the next step and integrate these strategies into your daily workflow.
The 4th Dnepropetrovsk iOS Practice Leaders Community Meet-Up, which took place onThursday, September 25.
Maxim Koshtenko, an iOS developer with 4+ years of experience in the area, held a presentation in which he told:
- about the most widespread problems which appear while writing tests and how to solve them;
- how to cover controllers with tests correctly and what should be visible in interface;
- why tests do not work for block-based and asynchronous code and how we can fix this;
- how to write tests for Core Data models;
- many other useful and interesting tips and tricks.
The presentation will be interesting for all iOS developers.
Re-checking the ReactOS project - a large reportPVS-Studio
The ReactOS project is rapidly developing. One of the developers participating in this project suggested that we re-analyzed the source code, as the code base is growing fast. We were glad to do that. We like this project, and we'll be happy if this article helps the developers to eliminate some bugs. Analysis was performed with the PVS-Studio 5.02 code analyzer.
Want to squeeze every last bit of performance out of your apps? I will show you how to let go of using Interface Builder to create better performing, more optimized, and leaner apps. I'll walk you through why it's better, how to create and move projects off of IB, building your UI in code, and how to gain a better understanding of how your code works from the ground up.
PVS-Studio team is about to produce a technical breakthrough, but for now let...PVS-Studio
Static analysis is most useful when it is done on a regular basis. Especially when the project is rapidly developing, like the Blender project, for example. Now it's time to check it once more, and see what suspicious fragments we'll find this time.
Python and Ruby implementations compared by the error densityPVS-Studio
Which programming language to start learning? Python or Ruby? Which one is better? Django or Ruby on Rails? Such questions can often be found on IT forums around the world. I suggest comparing not the languages themselves, but their reference implementations: CPython and MRI. In this article, we are going to cover the errors that were found by PVS-Studio in these projects.
В ходе доклада мы обсудим такие виды тестирования как:
- юнит тестирование,
- тестирование верстки,
- e2e-тестирование,
- тестирование производительности для FE
Также мы коснемся таких фундаментальных вещей, как:
- Что такое F.I.R.S.T
- Где заканчивается ответственность разработчика и начинает - ответственность QA инженера
- Как договариваться с бэкенд разработчиками
- И конечно, почему тесты нужны.
Errors detected in the Visual C++ 2012 librariesPVS-Studio
Static code analysis is one of the error detection methodologies. We are glad that this methodology is becoming more and more popular nowadays. Visual Studio which includes static analysis as one of its many features contributes to this process to a large extent. This feature is easy to try and start using regularly. When one understands one likes static code analysis, we are glad to offer a professional analyzer PVS-Studio for the languages C/C++/C++11.
Angular 16 is the biggest release since the initial rollout of Angular, and it changes everything: Bye bye zones, change-detection, life-cycle, children-selectors, Rx and what not.
Recorded webinar based on these slides given by Yaron Biton, Misterbit Coding-Academy’s CTO, can be found at: https://www.youtube.com/watch?v=92K1fgPbku8
Coding-Academy offers advanced web-techs training and software development services: Top-rated Full-stack courses for Angular, React, Vue, Node, Modern architectures, etc. | Available top-notch on-demand-coders trough Misterbit technological solutions | Coding-Academy Bootcamp: Hundreds of employed full-stack developers every year | Anything web, end to end projects | Tech companies and startups | Consulting to management and dev teams | Workshops for managers and leaders.
Every software developer knows object oriented programming; in fact most use it every day. Using OOP enables code reuse and creates readable and maintainable code.
But there are places where object oriented is just not enough. There are features that cut across the entire system such as security, logging and transaction handling which are hard to implement efficiently using the OO paradigm.
Aspect Oriented Programming (AOP) helps us deal with these application-wide concerns by adding a high level of reuse to the traditional OOP framework.
In this session I'll explain what AOP is all about and how it can be implemented in .NET using simple methods and industrial grade frameworks to improve the developer's everyday work by using aspects.
Every now and then, we have to write articles about how we've checked another fresh version of some compiler. That's not really much fun. However, as practice shows, if we stop doing that for a while, folks start doubting whether PVS-Studio is worth its title of a good catcher of bugs and vulnerabilities. What if the new compiler can do that too? Sure, compilers evolve, but so does PVS-Studio – and it proves, again and again, its ability to catch bugs even in high-quality projects such as compilers.
How to create SystemVerilog verification environment?Sameh El-Ashry
Basic knowledge for the verification engineer to learn the art of creating SystemVerilog verification environment.
Starting from the specifications extraction till coverage closure.
A presentation that Cam Barrie, James Brett and myself gave at Agile Australia 2013. The talk is about ways of building mobile apps that allow for the change and evolution you should expect when building exploratory mobile apps, and examples of the web and native code divide.
This is a talk that Jonny LeRoy and I gave at Thoughtworks Live in Sydney and Melbourne in May 2013. It's a high level look at how you can approach mobile development and strategies to evolve for a future of many APIs and many front end clients.
Slides from a presentation I gave on Cocoa Design Patterns - software design patterns that are suitable and common within Apple's Cocoa and Cocoa Touch frameworks using Objective C
UiPath Test Automation using UiPath Test Suite series, part 6DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 6. In this session, we will cover Test Automation with generative AI and Open AI.
UiPath Test Automation with generative AI and Open AI webinar offers an in-depth exploration of leveraging cutting-edge technologies for test automation within the UiPath platform. Attendees will delve into the integration of generative AI, a test automation solution, with Open AI advanced natural language processing capabilities.
Throughout the session, participants will discover how this synergy empowers testers to automate repetitive tasks, enhance testing accuracy, and expedite the software testing life cycle. Topics covered include the seamless integration process, practical use cases, and the benefits of harnessing AI-driven automation for UiPath testing initiatives. By attending this webinar, testers, and automation professionals can gain valuable insights into harnessing the power of AI to optimize their test automation workflows within the UiPath ecosystem, ultimately driving efficiency and quality in software development processes.
What will you get from this session?
1. Insights into integrating generative AI.
2. Understanding how this integration enhances test automation within the UiPath platform
3. Practical demonstrations
4. Exploration of real-world use cases illustrating the benefits of AI-driven test automation for UiPath
Topics covered:
What is generative AI
Test Automation with generative AI and Open AI.
UiPath integration with generative AI
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
Climate Impact of Software Testing at Nordic Testing DaysKari Kakkonen
My slides at Nordic Testing Days 6.6.2024
Climate impact / sustainability of software testing discussed on the talk. ICT and testing must carry their part of global responsibility to help with the climat warming. We can minimize the carbon footprint but we can also have a carbon handprint, a positive impact on the climate. Quality characteristics can be added with sustainability, and then measured continuously. Test environments can be used less, and in smaller scale and on demand. Test techniques can be used in optimizing or minimizing number of tests. Test automation can be used to speed up testing.
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.
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
Pushing the limits of ePRTC: 100ns holdover for 100 daysAdtran
At WSTS 2024, Alon Stern explored the topic of parametric holdover and explained how recent research findings can be implemented in real-world PNT networks to achieve 100 nanoseconds of accuracy for up to 100 days.
GridMate - End to end testing is a critical piece to ensure quality and avoid...ThomasParaiso2
End to end testing is a critical piece to ensure quality and avoid regressions. In this session, we share our journey building an E2E testing pipeline for GridMate components (LWC and Aura) using Cypress, JSForce, FakerJS…
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.
Dr. Sean Tan, Head of Data Science, Changi Airport Group
Discover how Changi Airport Group (CAG) leverages graph technologies and generative AI to revolutionize their search capabilities. This session delves into the unique search needs of CAG’s diverse passengers and customers, showcasing how graph data structures enhance the accuracy and relevance of AI-generated search results, mitigating the risk of “hallucinations” and improving the overall customer journey.
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofsAlex Pruden
This paper presents Reef, a system for generating publicly verifiable succinct non-interactive zero-knowledge proofs that a committed document matches or does not match a regular expression. We describe applications such as proving the strength of passwords, the provenance of email despite redactions, the validity of oblivious DNS queries, and the existence of mutations in DNA. Reef supports the Perl Compatible Regular Expression syntax, including wildcards, alternation, ranges, capture groups, Kleene star, negations, and lookarounds. Reef introduces a new type of automata, Skipping Alternating Finite Automata (SAFA), that skips irrelevant parts of a document when producing proofs without undermining soundness, and instantiates SAFA with a lookup argument. Our experimental evaluation confirms that Reef can generate proofs for documents with 32M characters; the proofs are small and cheap to verify (under a second).
Paper: https://eprint.iacr.org/2023/1886
Threats to mobile devices are more prevalent and increasing in scope and complexity. Users of mobile devices desire to take full advantage of the features
available on those devices, but many of the features provide convenience and capability but sacrifice security. This best practices guide outlines steps the users can take to better protect personal devices and information.
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
UiPath Test Automation using UiPath Test Suite series, part 5DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 5. In this session, we will cover CI/CD with devops.
Topics covered:
CI/CD with in UiPath
End-to-end overview of CI/CD pipeline with Azure devops
Speaker:
Lyndsey Byblow, Test Suite Sales Engineer @ UiPath, Inc.
14. Write your tests first.
Use tests to design
your code
“Classes typically resist the
transition from one user to
two, then the rest are easy”
- Kent
Beck, c2.wiki
93. and hack this file:
"${SYSTEM_DEVELOPER_DIR}/Tools/
RunUnitTests"
94. and hack this file:
"${SYSTEM_DEVELOPER_DIR}/Tools/
RunUnitTests"
http://longweekendmobile.com/
2011/04/17/xcode4-running-application-
tests-from-the-command-line-in-ios/
- what is unit testing\n- introduction to ocunit in general\n
- what is unit testing\n- introduction to ocunit in general\n
- what is unit testing\n- introduction to ocunit in general\n
- what is unit testing\n- introduction to ocunit in general\n
- Frank talk at the first cocoaheads of the year in February\n- thanks to Oliver for editing and uploading video\n
- balance your tests (Kevin doesn’t like this picture)\n- the unit tests are the work horse of your test suite\n- unit = translation unit in compiler speak\n- unit tests don’t talk to network, disk, database, Interface Builder\n(the unit testing tools can also be used to write tests for these things,\nbut let’s not call them unit tests)\n- xUnit v RSpec style tests\n
- balance your tests (Kevin doesn’t like this picture)\n- the unit tests are the work horse of your test suite\n- unit = translation unit in compiler speak\n- unit tests don’t talk to network, disk, database, Interface Builder\n(the unit testing tools can also be used to write tests for these things,\nbut let’s not call them unit tests)\n- xUnit v RSpec style tests\n
- balance your tests (Kevin doesn’t like this picture)\n- the unit tests are the work horse of your test suite\n- unit = translation unit in compiler speak\n- unit tests don’t talk to network, disk, database, Interface Builder\n(the unit testing tools can also be used to write tests for these things,\nbut let’s not call them unit tests)\n- xUnit v RSpec style tests\n
- balance your tests (Kevin doesn’t like this picture)\n- the unit tests are the work horse of your test suite\n- unit = translation unit in compiler speak\n- unit tests don’t talk to network, disk, database, Interface Builder\n(the unit testing tools can also be used to write tests for these things,\nbut let’s not call them unit tests)\n- xUnit v RSpec style tests\n
- balance your tests (Kevin doesn’t like this picture)\n- the unit tests are the work horse of your test suite\n- unit = translation unit in compiler speak\n- unit tests don’t talk to network, disk, database, Interface Builder\n(the unit testing tools can also be used to write tests for these things,\nbut let’s not call them unit tests)\n- xUnit v RSpec style tests\n
- balance your tests (Kevin doesn’t like this picture)\n- the unit tests are the work horse of your test suite\n- unit = translation unit in compiler speak\n- unit tests don’t talk to network, disk, database, Interface Builder\n(the unit testing tools can also be used to write tests for these things,\nbut let’s not call them unit tests)\n- xUnit v RSpec style tests\n
- balance your tests (Kevin doesn’t like this picture)\n- the unit tests are the work horse of your test suite\n- unit = translation unit in compiler speak\n- unit tests don’t talk to network, disk, database, Interface Builder\n(the unit testing tools can also be used to write tests for these things,\nbut let’s not call them unit tests)\n- xUnit v RSpec style tests\n
- balance your tests (Kevin doesn’t like this picture)\n- the unit tests are the work horse of your test suite\n- unit = translation unit in compiler speak\n- unit tests don’t talk to network, disk, database, Interface Builder\n(the unit testing tools can also be used to write tests for these things,\nbut let’s not call them unit tests)\n- xUnit v RSpec style tests\n
- this is partly true, but it’s hard to effectively test the whole app\n- need to look at the cost of testing\n-> time to write a test, time to fix a bug when it breaks\n-> want small, focused tests (understand 10 lines of code to fix the bug)\n- unit test boundary conditions / error cases (eg server rubbish)\n- can test things that are unlikely to come up in normal usage but are possible\n
- fallacy of unit testing is that it’s just about asserting behaviour or preventing bugs\n-> bigger benefit is about the design of your code\n- need to write your tests first to leverage this\n- want code with low coupling and high cohesion (that makes it easy to test)\n- doesn’t magically make you write good code, but bad code is hard to test\n- want reusable code (code fights being reused a second time)\n- keeps you from writing unnecessary code\n
- entire unit test suite should take seconds to run\n- if you can’t hold your breath while your test suite runs, don’t hold your breath that anyone will run it\n- specific errors, right after they occur\n- in context\n
- see them fail first: it is possible to have bugs in your tests\n- get them passing, only what’s needed\n- clean up after yourself while the tests are green (leverage tests)\n- a codebase not only well tested, but well maintained\n(easy to make changes - tests are there to help you)\n- refactor to make it easy to read\n- refactor your tests... but keep them easy to read (bit of duplication is ok)\n- he thought he was being pragmatic, you think he’s an idiot\n
\n
- true in the past, but not anymore\n- definitely not for unit testing frameworks\n- TDD/CI have been hard but getting better\n- how complicated is a testing framework anyway?\n\n
- true in the past, but not anymore\n- definitely not for unit testing frameworks\n- TDD/CI have been hard but getting better\n- how complicated is a testing framework anyway?\n\n
- true in the past, but not anymore\n- definitely not for unit testing frameworks\n- TDD/CI have been hard but getting better\n- how complicated is a testing framework anyway?\n\n
- that’s US dollars\n- I don’t have time to write tests\n- 90% of the life of a piece of code is later, more up front = less later\n- if your tests aren’t helping you write better software faster, change something\n- tests are easier to write than the main code, but they also make your real code easier\n- confidence to change things: once you’re comfortable with working in this way, I find it quicker than not writing tests\n
- that’s US dollars\n- I don’t have time to write tests\n- 90% of the life of a piece of code is later, more up front = less later\n- if your tests aren’t helping you write better software faster, change something\n- tests are easier to write than the main code, but they also make your real code easier\n- confidence to change things: once you’re comfortable with working in this way, I find it quicker than not writing tests\n
- that’s US dollars\n- I don’t have time to write tests\n- 90% of the life of a piece of code is later, more up front = less later\n- if your tests aren’t helping you write better software faster, change something\n- tests are easier to write than the main code, but they also make your real code easier\n- confidence to change things: once you’re comfortable with working in this way, I find it quicker than not writing tests\n
- testing is ultimately about pragmatism\n- plenty of good programmers don’t TDD, I’m not dogmatic about it\n- test the most important bits: separation of concerns is important\n- test parts with the most logic / more prone to change more (not less)\n* Models? Yes. Controllers? Probably. IB plumbing? Maybe. Views? Unlikely.\n- can even test position of views and memory, but what does that get you?\n- I want to show you the basics of some things you _can_ test, and how you can test them. It’s up to you\n
- testing is ultimately about pragmatism\n- plenty of good programmers don’t TDD, I’m not dogmatic about it\n- test the most important bits: separation of concerns is important\n- test parts with the most logic / more prone to change more (not less)\n* Models? Yes. Controllers? Probably. IB plumbing? Maybe. Views? Unlikely.\n- can even test position of views and memory, but what does that get you?\n- I want to show you the basics of some things you _can_ test, and how you can test them. It’s up to you\n
- testing is ultimately about pragmatism\n- plenty of good programmers don’t TDD, I’m not dogmatic about it\n- test the most important bits: separation of concerns is important\n- test parts with the most logic / more prone to change more (not less)\n* Models? Yes. Controllers? Probably. IB plumbing? Maybe. Views? Unlikely.\n- can even test position of views and memory, but what does that get you?\n- I want to show you the basics of some things you _can_ test, and how you can test them. It’s up to you\n
- I know what you’re thinking (boring, or reminds you of project estimation)\n- simple enough that none of us really have to think about how it works\n- algorithmically complex enough that we might screw it up\n(and it takes more than one test to drive a full implementation)\n
- I know what you’re thinking (boring, or reminds you of project estimation)\n- simple enough that none of us really have to think about how it works\n- algorithmically complex enough that we might screw it up\n(and it takes more than one test to drive a full implementation)\n
- I know what you’re thinking (boring, or reminds you of project estimation)\n- simple enough that none of us really have to think about how it works\n- algorithmically complex enough that we might screw it up\n(and it takes more than one test to drive a full implementation)\n
- not going to do a live coding demo\n(but hopefully appears on github and my blog soon)\n- create a new “Single View Application”, style up the NIB\n- design skills?\n(this is why I’ve been asking questions about Interface Builder)\n\n
- not going to do a live coding demo\n(but hopefully appears on github and my blog soon)\n- create a new “Single View Application”, style up the NIB\n- design skills?\n(this is why I’ve been asking questions about Interface Builder)\n\n
- not going to do a live coding demo\n(but hopefully appears on github and my blog soon)\n- create a new “Single View Application”, style up the NIB\n- design skills?\n(this is why I’ve been asking questions about Interface Builder)\n\n
- comes with unit tests by default\n- OCUnit is as easy as a check box, but other tools are easy too\n- used to be called SenTest or SenTestingKit, came bundled since Xcode 2\n- sets up applications tests / logic tests -> why?\n- application tests run in the context of your app (UI environment), can run on device)\n- Run with Cmd U -> shortcuts talk\n- but the example test fails\n
- comes with unit tests by default\n- OCUnit is as easy as a check box, but other tools are easy too\n- used to be called SenTest or SenTestingKit, came bundled since Xcode 2\n- sets up applications tests / logic tests -> why?\n- application tests run in the context of your app (UI environment), can run on device)\n- Run with Cmd U -> shortcuts talk\n- but the example test fails\n
- comes with unit tests by default\n- OCUnit is as easy as a check box, but other tools are easy too\n- used to be called SenTest or SenTestingKit, came bundled since Xcode 2\n- sets up applications tests / logic tests -> why?\n- application tests run in the context of your app (UI environment), can run on device)\n- Run with Cmd U -> shortcuts talk\n- but the example test fails\n
- comes with unit tests by default\n- OCUnit is as easy as a check box, but other tools are easy too\n- used to be called SenTest or SenTestingKit, came bundled since Xcode 2\n- sets up applications tests / logic tests -> why?\n- application tests run in the context of your app (UI environment), can run on device)\n- Run with Cmd U -> shortcuts talk\n- but the example test fails\n
- fail\n- imagine this is a build light\n- or one of those evil build bunnies\n\n
- let’s have a look at the example test file\n- SenTest is OCUnit, didn’t both to rename everything (like NSObject from NextStep)\n- subclass SenTestCase (like JUnit 3 days)\n- test methods return void and take no arguments, dynamically detected\n- extract code into common setUp/tearDown\n- remember to add these classes to the test bundle only\n
- let’s have a look at the example test file\n- SenTest is OCUnit, didn’t both to rename everything (like NSObject from NextStep)\n- subclass SenTestCase (like JUnit 3 days)\n- test methods return void and take no arguments, dynamically detected\n- extract code into common setUp/tearDown\n- remember to add these classes to the test bundle only\n
- let’s have a look at the example test file\n- SenTest is OCUnit, didn’t both to rename everything (like NSObject from NextStep)\n- subclass SenTestCase (like JUnit 3 days)\n- test methods return void and take no arguments, dynamically detected\n- extract code into common setUp/tearDown\n- remember to add these classes to the test bundle only\n
- let’s have a look at the example test file\n- SenTest is OCUnit, didn’t both to rename everything (like NSObject from NextStep)\n- subclass SenTestCase (like JUnit 3 days)\n- test methods return void and take no arguments, dynamically detected\n- extract code into common setUp/tearDown\n- remember to add these classes to the test bundle only\n
- let’s have a look at the example test file\n- SenTest is OCUnit, didn’t both to rename everything (like NSObject from NextStep)\n- subclass SenTestCase (like JUnit 3 days)\n- test methods return void and take no arguments, dynamically detected\n- extract code into common setUp/tearDown\n- remember to add these classes to the test bundle only\n
- let’s have a look at the example test file\n- SenTest is OCUnit, didn’t both to rename everything (like NSObject from NextStep)\n- subclass SenTestCase (like JUnit 3 days)\n- test methods return void and take no arguments, dynamically detected\n- extract code into common setUp/tearDown\n- remember to add these classes to the test bundle only\n
- let’s have a look at the example test file\n- SenTest is OCUnit, didn’t both to rename everything (like NSObject from NextStep)\n- subclass SenTestCase (like JUnit 3 days)\n- test methods return void and take no arguments, dynamically detected\n- extract code into common setUp/tearDown\n- remember to add these classes to the test bundle only\n
Controller Tests\n- 2 types: logic and IB plumbing\n- shouldn’t be much logic anyway, but start here and extract as needed\n(for simple apps, maybe it’s ok, but we’ve all seen almost entire apps implemented in a couple of UIViewControllers)\n- can test IB plumbing if you really want (much longer than dragging connections, but if people don’t look at their commits, can easily screw up and have pretty large effects)\n- large effect, should notice quickly, wont be a subtle bug\n
- let’s look at some example tests\n- long descriptive name, not camel case\n-- dual purpose (what’s being done, should happen)\n- set up without the NIB, independent of IB (our environment)\n(talk about tests that do use the NIB later)\n- feed in our own label for testing against (could use mock/fake, but can use real)\n- call method and assert outcome\n\n
- let’s look at some example tests\n- long descriptive name, not camel case\n-- dual purpose (what’s being done, should happen)\n- set up without the NIB, independent of IB (our environment)\n(talk about tests that do use the NIB later)\n- feed in our own label for testing against (could use mock/fake, but can use real)\n- call method and assert outcome\n\n
- let’s look at some example tests\n- long descriptive name, not camel case\n-- dual purpose (what’s being done, should happen)\n- set up without the NIB, independent of IB (our environment)\n(talk about tests that do use the NIB later)\n- feed in our own label for testing against (could use mock/fake, but can use real)\n- call method and assert outcome\n\n
- let’s look at some example tests\n- long descriptive name, not camel case\n-- dual purpose (what’s being done, should happen)\n- set up without the NIB, independent of IB (our environment)\n(talk about tests that do use the NIB later)\n- feed in our own label for testing against (could use mock/fake, but can use real)\n- call method and assert outcome\n\n
- let’s look at some example tests\n- long descriptive name, not camel case\n-- dual purpose (what’s being done, should happen)\n- set up without the NIB, independent of IB (our environment)\n(talk about tests that do use the NIB later)\n- feed in our own label for testing against (could use mock/fake, but can use real)\n- call method and assert outcome\n\n
- let’s look at some example tests\n- long descriptive name, not camel case\n-- dual purpose (what’s being done, should happen)\n- set up without the NIB, independent of IB (our environment)\n(talk about tests that do use the NIB later)\n- feed in our own label for testing against (could use mock/fake, but can use real)\n- call method and assert outcome\n\n
- have a look at the code as a whole\n-> everything fails, doesn’t even compile (a test doesn’t have to fail to run)\n-> sometimes quicker to write interface/empty implementation first\n(get autocompletion)\n-> add label property and reset action (IBOutlet/IBAction or do this later)\n- should be enough to build and run\n- press Cmd U again and run your tests\n
- that’s fine, we haven’t written the implementation yet\n- important to see your tests fail first, so you know they work\n
- that’s pretty simple\n- always a judgment call how simple is too simple\n- could introduce an ivar, convert to string\n(we know we’ll need to set that current variable back to zero at some stage)\n
- that’s pretty simple\n- always a judgment call how simple is too simple\n- could introduce an ivar, convert to string\n(we know we’ll need to set that current variable back to zero at some stage)\n
- that’s pretty simple\n- always a judgment call how simple is too simple\n- could introduce an ivar, convert to string\n(we know we’ll need to set that current variable back to zero at some stage)\n
- don’t need more than that - if you’re estimating\n- usually write one test at a time\n- if pair programming, ping pong between them\n-> tests are easy, move all the set up code to set up\njust call next 0, 1 or 2 times\n- next method won’t exist, go and create it, empty implementation\n
- don’t need more than that - if you’re estimating\n- usually write one test at a time\n- if pair programming, ping pong between them\n-> tests are easy, move all the set up code to set up\njust call next 0, 1 or 2 times\n- next method won’t exist, go and create it, empty implementation\n
- don’t need more than that - if you’re estimating\n- usually write one test at a time\n- if pair programming, ping pong between them\n-> tests are easy, move all the set up code to set up\njust call next 0, 1 or 2 times\n- next method won’t exist, go and create it, empty implementation\n
- don’t need more than that - if you’re estimating\n- usually write one test at a time\n- if pair programming, ping pong between them\n-> tests are easy, move all the set up code to set up\njust call next 0, 1 or 2 times\n- next method won’t exist, go and create it, empty implementation\n
- don’t need more than that - if you’re estimating\n- usually write one test at a time\n- if pair programming, ping pong between them\n-> tests are easy, move all the set up code to set up\njust call next 0, 1 or 2 times\n- next method won’t exist, go and create it, empty implementation\n
- don’t need more than that - if you’re estimating\n- usually write one test at a time\n- if pair programming, ping pong between them\n-> tests are easy, move all the set up code to set up\njust call next 0, 1 or 2 times\n- next method won’t exist, go and create it, empty implementation\n
- don’t need more than that - if you’re estimating\n- usually write one test at a time\n- if pair programming, ping pong between them\n-> tests are easy, move all the set up code to set up\njust call next 0, 1 or 2 times\n- next method won’t exist, go and create it, empty implementation\n
- don’t need more than that - if you’re estimating\n- usually write one test at a time\n- if pair programming, ping pong between them\n-> tests are easy, move all the set up code to set up\njust call next 0, 1 or 2 times\n- next method won’t exist, go and create it, empty implementation\n
- again, expect the test to fail\n- test failures are not always a bad thing\n
- brown madza\n- simplest thing for now, we’ll come back later\n
- don’t need more than that if you’re estimating\n- usually write one test at a time\n- if pair programming, ping pong between them\n-> tests are easy, move all the set up code to set up\njust call next 0, 1 or 2 times\n- next method won’t exist, go and create it, empty implementation\n- eventually, the algorithm will be complete no matter how far you count\n
- once your tests are passing, always look to improve your code\n- step 3: refactor\n- you’ll never do it later, do it now...\n(don’t take on technical debt)\n- probably not as awesome as an old english sports car\n
- once your tests are passing, always look to improve your code\n- step 3: refactor\n- you’ll never do it later, do it now...\n(don’t take on technical debt)\n- probably not as awesome as an old english sports car\n
- once your tests are passing, always look to improve your code\n- step 3: refactor\n- you’ll never do it later, do it now...\n(don’t take on technical debt)\n- probably not as awesome as an old english sports car\n
- once your tests are passing, always look to improve your code\n- step 3: refactor\n- you’ll never do it later, do it now...\n(don’t take on technical debt)\n- probably not as awesome as an old english sports car\n
controller has two main methods, but don’t really want all the algorithm code there\n- controllers get too busy, so separate out those details into a model\n- controller is left just plumbing things together, dealing with lifecycle\n- most iOS apps have almost the entire app written in UIViewController classes\n
controller has two main methods, but don’t really want all the algorithm code there\n- controllers get too busy, so separate out those details into a model\n- controller is left just plumbing things together, dealing with lifecycle\n- most iOS apps have almost the entire app written in UIViewController classes\n
controller has two main methods, but don’t really want all the algorithm code there\n- controllers get too busy, so separate out those details into a model\n- controller is left just plumbing things together, dealing with lifecycle\n- most iOS apps have almost the entire app written in UIViewController classes\n
controller has two main methods, but don’t really want all the algorithm code there\n- controllers get too busy, so separate out those details into a model\n- controller is left just plumbing things together, dealing with lifecycle\n- most iOS apps have almost the entire app written in UIViewController classes\n
controller has two main methods, but don’t really want all the algorithm code there\n- controllers get too busy, so separate out those details into a model\n- controller is left just plumbing things together, dealing with lifecycle\n- most iOS apps have almost the entire app written in UIViewController classes\n
controller has two main methods, but don’t really want all the algorithm code there\n- controllers get too busy, so separate out those details into a model\n- controller is left just plumbing things together, dealing with lifecycle\n- most iOS apps have almost the entire app written in UIViewController classes\n
controller has two main methods, but don’t really want all the algorithm code there\n- controllers get too busy, so separate out those details into a model\n- controller is left just plumbing things together, dealing with lifecycle\n- most iOS apps have almost the entire app written in UIViewController classes\n
- Interface Builder plumbing\n
- Interface Builder plumbing\n
- they’re written in Kiwi or OCUnit, but let’s not call them unit tests\n- it’s an interesting testing problem to try\n-> how good is it in practice?\n (everyone says no, but no one has tried it... the only team I know that tried it thinks they were the most valuable tests in the suite)\n- for an individual developer, or a team who actually reads git diffs before committing?\n
- let’s take a look at a few potential Interface Builder and NIB test\n- might want to check that you’ve set all your outlets correctly\n
- let’s take a look at a few potential Interface Builder and NIB test\n- might want to check that you’ve set all your outlets correctly\n
- might want to check your actions are correct\n
- might want to check your actions are correct\n
- check that your view gets cleaned up on low memory conditions\n- this one is potentially valuable\n- something we often forget, or get wrong but don’t often manually test\n-> could use screenshot based testing before and after as well\n
- check that your view gets cleaned up on low memory conditions\n- this one is potentially valuable\n- something we often forget, or get wrong but don’t often manually test\n-> could use screenshot based testing before and after as well\n
- didn’t get a really good chance to look at it yet\n- it’s a wrapper around OCUnit, so it runs within Xcode\n- heavily uses macros and blocks to make your tests nicer\n- only been out a few months, but actively worked on\n
- series of nested blocks to describe behaviour in certain context\n(in some ways it’s a bunch of different works for a similar function)\n- installation: static library, or cocoapods... vendor?\n
- series of nested blocks to describe behaviour in certain context\n- reads a lot more like plain English (but with ObjC syntax noise)\n\n
- series of nested blocks to describe behaviour in certain context\n- reads a lot more like plain English (but with ObjC syntax noise)\n\n
- series of nested blocks to describe behaviour in certain context\n- reads a lot more like plain English (but with ObjC syntax noise)\n\n
- in some ways it’s a bunch of different works for a similar function\n-> but these small changes actually change the way you think about your tests\n- Spec, not Test. “it should”, not “testThat”\n-> start describing the behaviour of your code, not testing the functionality\n- promotes test-first thinking\n
- Kiwi comes with its own mocking/stubbing capability\n(nicer syntax than OCMock, haven’t looked at LRMocky)\n
- look at our refactored code\n- controller is just passing messages between views and models\n
\n
- command line tooling is always an afterthought with Apple tools\n(surprising, given the Unix history)\n- need command line for running in CI without human intervention\n
- xcode build specifies workspaces and schemes as well\n- workspaces and schemes seem worthwhile\n- the build step will run your unit \n
\n
- training course is $70 or so, really worth while\n- Doug Sjoquist - idevblogaday, part 2 is out, more coming\n- Prag Prog had a few articles over the last year or two\n
- training course is $70 or so, really worth while\n- Doug Sjoquist - idevblogaday, part 2 is out, more coming\n- Prag Prog had a few articles over the last year or two\n
- training course is $70 or so, really worth while\n- Doug Sjoquist - idevblogaday, part 2 is out, more coming\n- Prag Prog had a few articles over the last year or two\n
- training course is $70 or so, really worth while\n- Doug Sjoquist - idevblogaday, part 2 is out, more coming\n- Prag Prog had a few articles over the last year or two\n
- training course is $70 or so, really worth while\n- Doug Sjoquist - idevblogaday, part 2 is out, more coming\n- Prag Prog had a few articles over the last year or two\n
- training course is $70 or so, really worth while\n- Doug Sjoquist - idevblogaday, part 2 is out, more coming\n- Prag Prog had a few articles over the last year or two\n
- training course is $70 or so, really worth while\n- Doug Sjoquist - idevblogaday, part 2 is out, more coming\n- Prag Prog had a few articles over the last year or two\n
- training course is $70 or so, really worth while\n- Doug Sjoquist - idevblogaday, part 2 is out, more coming\n- Prag Prog had a few articles over the last year or two\n