Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem Solving
#7
I start by writing a failing test. That is, I write an automated test (e.g. a unit test) that expresses, in code, what should happen in a scenario I want to implement. In so doing, I'm focused on one small part of the problem (i.e. a particular scenario) and think about things needed to make it work (like any input data, or system state). I then run the test to make sure it fails (which it should, because there isn't an implementation yet) and then write enough of an implementation to make it pass. Once it's passing, I perform any necessary refactoring (extracting methods, putting parts of the code in the right place, making sure names are as expressive as they should be).

This "red, green, refactor" cycle is known as test-driven development (TDD).
Reply


Messages In This Thread
Problem Solving - by PistAchiYo - Oct-06-2019, 03:34 AM
RE: Problem Solving - by wavic - Oct-06-2019, 09:34 AM
RE: Problem Solving - by ichabod801 - Oct-06-2019, 01:51 PM
RE: Problem Solving - by perfringo - Oct-07-2019, 05:43 AM
RE: Problem Solving - by buran - Oct-07-2019, 05:56 AM
RE: Problem Solving - by ndc85430 - Oct-13-2019, 02:29 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How important is math for software engineering, and does it help in problem solving? larridde 4 3,044 Mar-10-2020, 03:25 PM
Last Post: wavic

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020