Author Topic: Unit Testing?  (Read 2706 times)

0 Members and 1 Guest are viewing this topic.

Offline davidshq

  • Newbie
  • Posts: 55
    • View Profile
Unit Testing?
« on: March 03, 2019, 01:28:22 pm »
Hi All,

I decided working on refactoring one of Hutsell's Wargames would be a good way for me to work through Martin Fowler's classic (and revised) Refactoring book. As part of this endeavor I'd love to be able to do some unit testing to make sure my refactorings don't break everything. :) I was wondering if anyone has done any unit testing in QB64? If so, how you accomplished it and if you have built any tools you'd be willing to share?

Thanks!
Dave

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: Unit Testing?
« Reply #1 on: March 03, 2019, 01:43:03 pm »
I always thought of unit testing as unit dependent, and not universal. In other words, each unit is unique and needs a unique method of testing. I made a really simple one to test a string math "unit" I've been working on. I just feeds in random numbers and operatons then checks numeric results against my string results. https://www.tapatalk.com/groups/qbasic/working-on-some-ideas-for-base-10-math-operations--t39442.html

I'll be interested to see how others respond to this request. There's a good chance I'm missing something, since I don't often have a need for anymore than beta testing by manual means for most of my projects.

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline davidshq

  • Newbie
  • Posts: 55
    • View Profile
Re: Unit Testing?
« Reply #2 on: March 03, 2019, 09:54:35 pm »
Thanks Pete!

Haven't had a chance to look at it much, but wondering if porting fbcunit (FreeBasic unit testing) might be a quick solution:

https://github.com/jayrm/fbcunit