BREAKING: USPS slashes address verification to 60 addresses/hour. What now?
Smarty

Your Convey needs more focus

Smarty header pin graphic
Updated July 2, 2025
Tags
Smarty header pin graphic

One of the great benefits of TDD/BDD is that you usually don't have to spend much, if any time at all in a debugger. To enter a debugger is to admit a loss of control over the system under test. Even so, there are times when you do need to debug something, even if you're maintaining the discipline.

Lately, most of my coding is in GoLang. Coming from using an IDE almost exclusively to write Python (using PyCharm) and C# (using VS and ReSharper), and knowing how great the visual debugging tools are it's hard to fathom using a console-based debugger for GoLang code. Yes, I know about godbg, which is an amazing tool, but I would rather stay in my test runner of choice, which is GoConvey.

Up until now I would do something like this to achieve debugging:

  • Add log.Println statements where the bugs are
  • Use SkipConvey to limit execution to the test in question (this can get tedious if the test suite is large)
  • Run the tests and observe the output

Or...

  • Add the logging statements
  • Use an init function in the test code to substitute a nil writer to the logger
  • Substitute stdout in the Convey scope that executes the code with logging
  • run the tests and observe the output

Yuck.

Now, there's a better way. It still means putting in some logging, which may or may not be temporary. But, all you have to do now is something like this:

FocusConvey("Subject: Integer incrementation and decrementation", t, func() {
	var x int

	FocusConvey("Given a starting integer value", func() {
		x = 42

		FocusConvey("When incremented", func() {
			x++

			Convey("The value should be greater by one", func() {
				So(x, ShouldEqual, 43)
			})
			FocusConvey("The value should NOT be what it used to be", func() {
				So(x, ShouldNotEqual, 42)
			})
		})
		Convey("When decremented", func() {
			x--

			Convey("The value should be lesser by one", func() {
				So(x, ShouldEqual, 41)
			})
			Convey("The value should NOT be what it used to be", func() {
				So(x, ShouldNotEqual, 42)
			})
		})
		Reset(func() {
			x = 0
		})
	})
})

In this code, only those scopes declared with FocusConvey will be executed, the reset will be ignored. Much easier to toggle for debugging purposes.

Of course, you shouldn't leave the test suite with a bunch of FocusConvey calls lying around. After you fix your code get rid of the Focus and just keep Convey.

Happy debugging!

Subscribe to our blog!
Learn more about RSS feeds here.
Read our recent posts
How to build and validate address lists for direct mail marketing
Arrow Icon
Looking to build a direct mail marketing campaign? You’ve come to the right spot. Before you can send marketing mail like a pro, you’ll need to build a list of verified addresses. Otherwise, frequent misdeliveries and costly redeliveries can take the wind right out of your campaign’s sails. On top of that, a bad address list could lead you to miss out on mind-blowing postal discounts. 😱Don’t let bad addresses capsize your campaign. With a US Master Address List of over 210 million verified addresses—available by state, county, or nationwide—and shipshape US Address Verification, you can construct new lists or clean active ones with the swagger of a seasoned captain.
USPS API rate limit capped at 60 requests per hour: How to prepare and why many are choosing Smarty
Arrow Icon
Because who doesn’t love juggling one more thing during the holiday season…? A major shift in the address-verification landscape is approaching at the beginning of the new year. On January 25, 2026, the United States Postal Service (USPS) will officially retire its long-standing Web Tools APIs, a free API that previously allowed for approximately 5 address lookups per transaction. This includes the legacy USPS Address Information APIs that many organizations have depended on for years. Under USPS’s new API structure, the default quota for many services, including the Addresses API, is 60 requests per hour.
Pinpoint 2025: Day 1 recap
Arrow Icon
For two days, Smarty users gathered together with other address data experts for Pinpoint, Smarty’s first virtual user conference, where developers, industry experts, and product specialists talked all things addresses and pulled back the curtain on address data solutions. Attendees asked questions about cloud-based software, the impact of accurate address data on fintech and insurance companies, and the ROI of good address data across all industries. Plus, attendees got to take a peek behind the scenes and see what makes Smarty’s address data solutions tick.

Ready to get started?