Hyunwoo Choihyunwoochoi.hashnode.dev·Jul 9, 2023TDD - You can write code without actual hardware (Part III)This post is an extension of "TDD - You can write code without actual hardware (Part II)". Previously, eeprom_controller.c includes the read-byte function and write-byte function. Let's start to add a multiple write-byte test and a multiple read-byte...DiscussTDD - Embedded System using Cunit testing
Hyunwoo Choihyunwoochoi.hashnode.dev·Jul 8, 2023TDD - You can write code without actual hardware (Part II)This post is an extension of "TDD - You can write code without actual hardware (Part I)". Previously, eeprom_controller.c includes only the read-byte function. Let's start to add a write-byte test in test_eeprom_controller.c. After writing one byte i...DiscussTDD - Embedded System using CTDD (Test-driven development)
Hyunwoo Choihyunwoochoi.hashnode.dev·Jul 7, 2023TDD - You can write code without actual hardware (Part I)This post is an extension of "Another mock example using StubWithCallback". Previously, test_eeprom_controller.c includes only one test case. void test_mock_write_read_byte(void) { uint32_t test_address = 0; uint8_t write_data = 0xAA; fla...Discuss·51 readsTDD - Embedded System using Cceedling
Hyunwoo Choihyunwoochoi.hashnode.dev·Aug 14, 2022TDD ExampleBefore starting TDD, we need software spec and test cases. Our goal is demonstrating software development process with a simple example:fizzbuzz problem. Here is software spec for fizzbuzz problem: if given number is divided up by 3, print fizz. ...Discuss·55 readsTDD - Embedded System using Ctest driven development
Hyunwoo Choihyunwoochoi.hashnode.dev·Aug 12, 2022Ceedling with Visual Studio CodeTest Driven Development is required to go through multiple times of small changes in production code and test code concurrently. It would be nice to have GUI IDE to load all files in one workspace. Also, you might want to debug test code during run-t...Discuss·1.4K readsTDD - Embedded System using Cceedling
Hyunwoo Choihyunwoochoi.hashnode.dev·Aug 12, 2022Another mock example using StubWithCallbackAuto-generated mock files in Ceedling provide Ignore and Expect functions as well as the StubWithCallback function. Here is an example of StubWithCallback use case: external EEPROM can be accessed via specific SPI commands such as read byte and write...Discuss·1 like·451 readsTDD - Embedded System using CC
Hyunwoo Choihyunwoochoi.hashnode.dev·Aug 10, 2022How to deal with dependency issues among modulesIn general, firmware cannot be discussed without hardware dependency in embedded systems. For example, the led_controller module needs to use functions from the interface_gpio module to control hardware. When we need to unit test this type of interfa...Discuss·47 readsTDD - Embedded System using Cceedling
Hyunwoo Choihyunwoochoi.hashnode.dev·Aug 10, 2022Get familiar with CeedlingHow to set up Ceedling From last post, Ceedling was introduced as a unit testing framework for C. In this post, I want to show how to set up Ceedling and how to use Ceedling with the simple example. Ceedling is required to install ruby. I download...Discuss·117 readsTDD - Embedded System using Cceedling
Hyunwoo Choihyunwoochoi.hashnode.dev·Aug 10, 2022Unit Testing For Embedded C codeHow often firmware engineers expose to unit testing? This was an unusual topic to me at first while I have worked as firmware engineer for microcontrollers. Most of microctonroller applications are still developed in C or C++. In the past, while yo...Discuss·154 readsTDD - Embedded System using CC