This time, let's solve another Leetcode problem, Find Pivot Index, using Test Driven Development! In this video, I will show you how we can solve this problem starting from O(n^2) to more optimize O(n) time complexity, using Test Driven Development as our main development strategy. https://youtu.be/BaEixzVqZtU GitHub repository https://github.com/arifinfrds/ LeetCode: https://leetcode.com/problems/find-pivot-index/description/ https://leetcode.com/problems/find-pivot-index/solutions/3271745/swift-o-n-and-o-n-2-solution/ #findpivotindex #tdd #testdrivendevelopment … Continue reading #9 Swift – TDD + Find Pivot Index
Test Double : Stub
In the last article, we've already talk about Test Double in general. In this article, we will talk about on of test double, called stub. Testing a component can be helped with another collaborator component with predefined behavior. This is called stubbing. 💡 Stubs provide canned answers to calls made during the test, usually not responding at … Continue reading Test Double : Stub