The capabilities of CubeSats have grown significantly since the first of these small satellites was launched in the early 2000s. These capabilities enable a wide range of mission profiles, with CubeSats emerging as viable platforms for certain space-based astronomical research applications. The Educational Irish Research Satellite (EIRSAT-1) is a CubeSat being developed as part of the European Space Agency's Fly Your Satellite! program. In addition to its educational aims, the mission is driven by several scientific and technological goals, including goals related to a novel gamma-ray instrument for the detection of bright transient astrophysical sources, such as gamma-ray bursts. This work provides a detailed description of the software development life-cycle for EIRSAT-1, addressing the design, development and testing of robust flight software, aspects of payload interfacing, and risk mitigation. The described design-to-testing approach was implemented to establish, prior to launch, that EIRSAT-1 can perform its intended mission. Constraints and challenges typically experienced by CubeSat teams, which can impact the likelihood of mission success, are considered throughout this work, and lessons learned are discussed. The aim of this work is to highlight the advanced capabilities of CubeSats while providing a useful resource for teams implementing their own flight software. © The Authors. Published by SPIE under a Creative Commons Attribution 4.0 International License. Distribution or reproduction of this work in whole or in part requires full attribution of the original publication, including its DOI.