We may earn an affiliate commission when you visit our partners.
Course image
Sergey Kargopolov

Unit Testing is a must-have skill and this video course is about Unit Testing Swift code.

Read more

Unit Testing is a must-have skill and this video course is about Unit Testing Swift code.

If you take this video course, you will learn how to follow a Test Driven Development process to implement a feature for an iOS mobile app built with Swift.   

This video course starts with Unit Test basics and continues with a very practical set of lessons that demonstrates how to follow a Test-Driven process to implement the User Signup feature in the Model View Presenter mobile app.

By the end of this video course, you will have a very clear understanding of how to write Unit Tests and UI Tests for your Swift mobile application, and you will be able to test even very complex Swift code.

If you are a freelance developer you might postpone learning how to unit test iOS app for some time. But if you are planning to join a bigger team, then unit testing is a must-have skill for you to be able to work on important app features.

Have a look through the curriculum of this course to see what it covers. Watch a few sample video lessons. And if you have questions, I am always here to help you.

Enroll now

What's inside

Learning objectives

  • Unit test ios mobile app
  • Xctest framework
  • Create, run and debug unit tests
  • Mock dependencies
  • Use dependency injection
  • Ui testing

Syllabus

Introduction
Source Code
Basics of Unit Testing in Xcode
Testing Pyramid
Read more
The F.I.R.S.T Principle
Test-Driven Development Lifecycle
Enable Unit Tests in Xcode Project
The Default Unit Test Case Class Explained
The addTeardownBlock()
Creating a New Test Case Class
Ways to Run Unit Test in Xcode
The Default Order of Unit Tests
Unit Test Naming Requirements
Ways to Disable or Skip Unit Test
Viewing Test Results
Code Coverage
100% Code Coverage
Test Method Code Structure. Arrange, Act, Assert.



Enabling the Failure Debugger Breakpoint
Parallel Distributed Testing on Multiple Simulator Clones
TDD. Implementing Model Validator
Test That User First Name is Valid
Test for a very short First Name
Test for a very long First Name
Challenge: Apply TDD to Implement Validation of Last Name and Email Address
Test if user passwords match
Test if user passwords do not match
Test Code in Isolation
Dependency Injection
Use of Protocols
Test Toubles - Fake, Mock, Stub, Dummy
TDD. Implementing Network Service Class.
Create Initial SignupWebServiceTests Unit Test class
Create Initial SignupWebService Class
Implementing SignupFormRequestModel
Adding CompletionHandler to Signup Method Signature
Implementing the Initial SignupResponseModel
Implementing the Initial SignupErrors Enum
Organize Project Folders
Assert that the Response Status is Equal to "ok"
Adding an Expectation and an Asynchronous Wait Method
Inject URL String
Prepare URL
Prepare URL Request Object
Create DataTask
Inject URLSession
Return Response Model
Trying how it works with Real HTTP Request
Mock URLProtocol
Make URLSession use MockURLProtocol
Handle Unknown JSON Response Model
When Empty URL Provided Return a Specific Error Message
Refactor SignupErrors Enum
Test URL Request Failure
Check Code Coverage
TDD. Implementing Presenter Class in MVP Application
Create Presenter Unit Test Class and Test Method
Create Signup Form Model Struct
Create SignupPresenter class and the processUserSignup() method
Create Initial MockSignupModelValidator class
Create Validator Protocol
Inject Validator Mock and validate each property
Refactor
Unit Test to verify the signup() was called
Create SignupWebService Mock Class
Signup Web Service Protocol
Inject Signup Web Service Mock in to Presenter
Unit Test to assert that Presenter calls a method on View Delagate
Create View Delegate Protocol and MockSignupViewDelegate
Inject View Delegate into Presenter
Counting number of times a method was called
Verify that successfulSignup() called one time only
Coding Challenge
Assert that Presenter calls a Error Handler on View Delagate
Review Code Coverage of Presenter Class
Unit Testing View Controller
Create a New Test Class and a Test Method
Test UITextFields are initially empty
Test UITextField has a referencing outlet
Test UIButton has @IBAction assigned to it
Test UIButton Action invokes code in Presenter
Create MockSignupPresenter class
Inject MockSignupPresenter into View Controller
Testing Old or Legacy Code
Refactor Massive View Controllers
Use Protocols and Dependency Injection
Adding code to existing methods
Break large functions into smaller ones
Wrapping existing classes. Decorator pattern.
Examples: Ways to Load UIViewController in a Unit Test

Good to know

Know what's good
, what to watch for
, and possible dealbreakers
Covers unit testing, dependency injection, handling of asynchronous code, testing API calls, and testing UI elements
Relevant to iOS and mobile app development professionals
Taught by an experienced iOS developer with a strong understanding of unit testing
Requires some prior experience with iOS development and unit testing

Save this course

Save Unit Testing Swift Mobile App to your list so you can find it easily later:
Save

Activities

Be better prepared before your course. Deepen your understanding during and after it. Supplement your coursework and achieve mastery of the topics covered in Unit Testing Swift Mobile App with these activities:
Follow a tutorial on unit testing in Swift
Following a tutorial on unit testing in Swift can provide a structured approach to learning the concepts and best practices.
Browse courses on Unit Testing
Show steps
  • Search for a tutorial on unit testing in Swift
  • Follow the steps in the tutorial
  • Try to implement the concepts you learn in your own code
Attend a workshop on unit testing in Swift
Attending a workshop can provide a structured and immersive learning experience on unit testing in Swift.
Browse courses on Unit Testing
Show steps
  • Search for a workshop on unit testing in Swift
  • Register for the workshop
  • Attend the workshop
Join a study group or online forum for unit testing
Engaging with peers can provide valuable insights, support, and motivation for learning about unit testing.
Browse courses on Unit Testing
Show steps
  • Search for a study group or online forum on unit testing
  • Join the group or forum
  • Participate in discussions and ask questions
Six other activities
Expand to see all activities and additional details
Show all nine activities
Practice writing unit tests
Writing unit tests is key to developing robust Swift applications. Practice writing unit tests to reinforce your understanding of the concepts covered in this course.
Browse courses on Unit Testing
Show steps
  • Create a new Xcode project
  • Write a simple Swift function
  • Write a unit test for the function
  • Run the unit test
Develop a personal project that utilizes unit testing
Building a personal project can provide practical experience in applying unit testing to a real-world scenario.
Browse courses on Unit Testing
Show steps
  • Come up with an idea for a personal project
  • Design and implement the project
  • Write unit tests for the project
  • Deploy and test the project
Develop a unit testing framework for a Swift project
Developing a unit testing framework can help you gain a deeper understanding of the principles and implementation of unit testing.
Browse courses on Unit Testing
Show steps
  • Design the architecture of the framework
  • Implement the core functionality of the framework
  • Write unit tests for the framework
  • Document the framework
Write a blog post or article about unit testing in Swift
Writing about unit testing can help you reinforce your understanding of the concepts and share your knowledge with others.
Browse courses on Unit Testing
Show steps
  • Choose a topic related to unit testing in Swift
  • Research and gather information
  • Write the blog post or article
  • Publish and promote your content
Participate in a hackathon or coding competition that involves unit testing
Participating in a hackathon or coding competition can provide a fun and challenging way to apply your unit testing skills in a real-world setting.
Browse courses on Unit Testing
Show steps
  • Find a hackathon or coding competition that involves unit testing
  • Form a team or work individually
  • Develop a solution to the problem
  • Submit your solution
Mentor a junior developer on unit testing in Swift
Mentoring others can solidify your understanding of unit testing while also helping others learn and grow.
Browse courses on Unit Testing
Show steps
  • Find a junior developer who is interested in learning about unit testing
  • Establish a regular meeting schedule
  • Provide guidance and support
  • Review code and provide feedback

Career center

Learners who complete Unit Testing Swift Mobile App will develop knowledge and skills that may be useful to these careers:
iOS Developer
iOS Developers design, develop, and test iOS applications. A course on "Unit Testing Swift Mobile App" is very helpful to one who wishes to pursue a career as an iOS Developer because it teaches learners the whole process of writing Unit Tests and UI Tests for Swift mobile apps, which is a key skill for an iOS Developer to have.
Mobile Application Developer
Mobile Application Developers design, develop, and test mobile applications. A course on "Unit Testing Swift Mobile App" is very helpful to one who wishes to pursue a career as a Mobile Application Developer because it teaches learners the whole process of writing Unit Tests and UI Tests for Swift mobile apps, which is a key skill for a Mobile Application Developer to have.
Software Development Engineer in Test
Software Development Engineers in Test (SDETs) are responsible for testing software applications and ensuring their quality. A course on "Unit Testing Swift Mobile App" is very helpful to one who wishes to pursue a career as an SDET because it builds a strong foundation in unit testing, which is a key part of software testing.
Quality Assurance Analyst
Quality Assurance Analysts (QAAs) are responsible for ensuring the quality of software products. A course on "Unit Testing Swift Mobile App" is very helpful to one who wishes to pursue a career as a QAA because it provides a comprehensive overview of unit testing, which is a critical skill for a QAA to have.
Software Tester
Software Testers test software applications and systems to ensure their quality. A course on "Unit Testing Swift Mobile App" is helpful to one who wishes to pursue a career as a Software Tester because it provides a comprehensive overview of unit testing, which is a critical skill for a Software Tester to have.
Software Engineer
Software Engineers design, develop, test, deploy, and maintain software programs and systems. A course on "Unit Testing Swift Mobile App" is very helpful to one who wishes to pursue a career as a Software Engineer or a similar role because mobile application development is a major branch of software engineering. This course teaches learners the whole process of writing Unit Tests and UI Tests for Swift mobile apps, which is a very useful skill for a Software Engineer to have.
Computer Programmer
Computer Programmers write, test, and maintain the code that makes software programs and applications work. A course on "Unit Testing Swift Mobile App" is helpful to one who wishes to pursue a career as a Computer Programmer because it teaches learners the whole process of writing Unit Tests and UI Tests for Swift mobile apps. Even though this course is specific to iOS, many of the concepts and principles can be applied to other programming languages and platforms.
Android Developer
Android Developers design, develop, and test Android applications. While a course on "Unit Testing Swift Mobile App" is not directly related to Android development, it may be useful to one who wishes to pursue a career as an Android Developer because it provides a comprehensive overview of unit testing, which is a key skill for a mobile application developer in general to have.
Web Developer
Web Developers design, develop, and test websites. While a course on "Unit Testing Swift Mobile App" is not directly related to web development, it may be useful to one who wishes to pursue a career as a Web Developer because it provides a comprehensive overview of unit testing, which is a key skill for a web developer in general to have.
Technical Support Specialist
Technical Support Specialists provide technical support to users of software applications and systems. A course on "Unit Testing Swift Mobile App" may be useful to one who wishes to pursue a career as a Technical Support Specialist because it provides a comprehensive overview of unit testing, which is a skill that can be helpful in troubleshooting software issues.
IT Consultant
IT Consultants provide consulting services to businesses on how to use and implement software and technology solutions. A course on "Unit Testing Swift Mobile App" may be useful to one who wishes to pursue a career as an IT Consultant because it provides a comprehensive overview of unit testing, which is a skill that can be helpful in evaluating and recommending software solutions to clients.
Project Manager
Project Managers plan, execute, and close out projects. A course on "Unit Testing Swift Mobile App" may be useful to one who wishes to pursue a career as a Project Manager because it provides a comprehensive overview of unit testing, which is a skill that can be helpful in managing software development projects.
Product Manager
Product Managers plan and manage the development of software products. A course on "Unit Testing Swift Mobile App" may be useful to one who wishes to pursue a career as a Product Manager because it provides a comprehensive overview of unit testing, which is a skill that can be helpful in managing the development of software products.
Business Analyst
Business Analysts analyze business needs and develop solutions to improve business processes. A course on "Unit Testing Swift Mobile App" may be useful to one who wishes to pursue a career as a Business Analyst because it provides a comprehensive overview of unit testing, which is a skill that can be helpful in analyzing and improving software-based business processes.
Data Analyst
Data Analysts collect, clean, and analyze data to identify trends and patterns. A course on "Unit Testing Swift Mobile App" may be useful to one who wishes to pursue a career as a Data Analyst because it provides a comprehensive overview of unit testing, which is a skill that can be helpful in analyzing and verifying data-driven insights.

Reading list

We've selected ten books that we think will supplement your learning. Use these to develop background knowledge, enrich your coursework, and gain a deeper understanding of the topics covered in Unit Testing Swift Mobile App.
Provides a comprehensive overview of design patterns, covering topics such as creational, structural, and behavioral patterns. It classic work in the field of software design.
Provides a comprehensive overview of test-driven development (TDD), a software development process that emphasizes writing tests before writing code. It covers the principles and practices of TDD and includes practical examples.
Offers guidance on writing clean, maintainable, and extensible code. It covers principles such as SOLID, DRY, and YAGNI, and emphasizes the importance of refactoring and testing.
Offers a comprehensive guide to software architecture and design. It presents the Clean Architecture principles and patterns and provides guidance on how to apply them in practice.
Provides a thorough exploration of unit testing principles and practices. It covers topics such as test design, test automation, and test refactoring.
Provides a practical guide to design patterns, covering topics such as creational, structural, and behavioral patterns. It uses a humorous and engaging approach to explain complex concepts.
Offers a practical guide to agile testing, covering topics such as agile testing principles, practices, and tools. It provides guidance on how to integrate testing into agile development processes.
Offers a comprehensive guide to software testing, covering topics such as test planning, test execution, and test reporting. It emphasizes the importance of a craftsman's approach to testing.
Offers a comprehensive overview of unit testing principles, practices, and patterns. It covers topics such as test planning, test design, and test automation.

Share

Help others find this course page by sharing it with your friends and followers:

Similar courses

Here are nine courses similar to Unit Testing Swift Mobile App.
Advanced Unit Testing with Swift​ iOS Through Mocks and...
Most relevant
Swift iOS UI and Unit Testing
Most relevant
CoreData for Swift Development (Swift 4.2 & iOS 12)
Most relevant
Introduction to iOS Mobile Application Development
Most relevant
Engineering Maintainable Android Apps
Most relevant
iOS 11 Fundamentals
Most relevant
The Ultimate 70+ Hours iOS Development Bootcamp
Most relevant
WPF and MVVM: Test Driven Development of ViewModels
Most relevant
Learn Programming for App Development on the Apple Watch
Most relevant
Our mission

OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.

Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.

Find this site helpful? Tell a friend about us.

Affiliate disclosure

We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.

Your purchases help us maintain our catalog and keep our servers humming without ads.

Thank you for supporting OpenCourser.

© 2016 - 2024 OpenCourser