Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 187461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T15:49:39+00:00 2026-05-11T15:49:39+00:00

Recently, I’ve started to working on Email2SMS feature in our product. When I joined

  • 0

Recently, I’ve started to working on Email2SMS feature in our product. When I joined the project this component had zero code coverage by unit-tests. Legacy code.

Since I started to working on it, I was using test-first approach. But code quality was very low. It was very hard to split it and tests small chunks by unit-tests, so I decided to write integration test.

There is php script, which accepts some message info, search for user in DB and save some info if everything is OK.

$last_line = system('php emailtosms.php -file=unicode_message.txt ', $retval);  $this->assertStringExistsInLogFile('Email to SMS message was not sent'); 

Is it bad or not? How would you solve this problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T15:49:40+00:00Added an answer on May 11, 2026 at 3:49 pm

    Not so good.

    Test at a lower level, by having the emailtosms.php script as a simple wrapper that processes the command line args, and then pass off to more testable class. Depending on the final step, you could write unit tests to do almost every but the final send (maybe mock the final step that actually sends it, and just store it to a variable, then check you’ve got something valid there).

    The final integration, runs the full class end-to-end, and check its output, looking at the final log – or a little higher-level, what would be put into to log.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Recently we have released our product. Our team decided to preserve the source code
Recently, I started changing some of our applications to support MS SQL Server as
Recently two users of our software from the same company started experiencing random closures
Recently, we discovered odd behavior in some old code. This code has worked for
Recently downloaded some code for a minor open-source project related to a small webgame
Recently I've been doing quite the project mostly working with the DateTime class. Now,..
Recently in a project, I had a multiprocessing Process that crashed. A child process
recently I started a small Django project that I developed on a local machine
Recently I started working with RAD and WebSphere on development of web services and
Recently started with ASP.NET and MVC and have a few questions on working with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.