Natural Language Programming: From Requirements to Reliable Delivery

    AI coding tools can turn natural language requirements into working code, but reliable results still depend on clear rules, testing, and accountability. Using an email-cleaning task as an example, this article explains how to define inputs and acceptance criteria, distinguish validation levels, verify results, and build an auditable workflow that can scale from a personal script to an enterprise application.

    1. Programming Is Becoming More Accessible, but Correctness Still Matters

    In research, operations, and business analysis, many tasks are straightforward yet time-consuming: organizing spreadsheets, identifying duplicate records, checking field formats, merging files, and generating statistical reports. These tasks typically have defined inputs and outputs, along with relatively stable processing rules, making them good candidates for automation.

    Traditionally, business users had to learn programming syntax, configure a runtime environment, or wait for developers to become available. AI coding tools can now generate code from natural language descriptions, shifting the user’s role from writing every instruction to defining goals, constraints, and acceptance criteria.

    This does not mean programming knowledge has lost its value. Rather, a new layer translates requirements into implementations. Users can describe a problem, have a tool generate code, and refine it through execution and feedback.

    However, one boundary remains essential: generated code does not prove that the requirements were understood correctly, and a program that runs does not necessarily produce correct results.

    A reliable natural language programming workflow is therefore:

    Business problem → Explicit rules → Generated implementation → Small-sample validation → Full-data execution → Results audit

    Compared with “describe it and run it,” this workflow adds several steps. Those steps reduce the risk of accidental data deletion, incorrect statistics, and results that cannot be traced back to their source.

    2. What an Email-Cleaning Task Reveals About Requirements

    Suppose a researcher receives a spreadsheet containing roughly 4,000 records and needs to clean its email field. The data includes missing values, leading and trailing spaces, obvious formatting errors, and duplicates. The required deliverables are a usable email list and a summary report.

    At first glance, the requirement seems simple: “Remove invalid emails and duplicates.” In practice, that sentence leaves several decisions unresolved:

    • Which column contains the email addresses, and is its name fixed?
    • Should blank strings and missing values receive the same treatment?
    • Can leading and trailing whitespace be removed?
    • Are two addresses that differ only in case duplicates?
    • When duplicates occur, should the first record be retained, or the one with more complete information?
    • Should the output contain only email addresses, or preserve other fields?
    • Should excluded records include reasons for their exclusion?
    • Does “valid” mean that an address meets a defined format, or that it can actually receive email?

    Without explicit answers, the tool may choose default behaviors. Those defaults may be reasonable, but they may not match the business requirements.

    This is an often-overlooked aspect of natural language programming: result quality depends less on prompt length than on whether the business rules are complete, explicit, and testable.

    3. Turn a Short Request into an Executable Task Specification

    An effective task specification should cover at least five areas: inputs, processing rules, outputs, constraints, and acceptance criteria.

    Inputs: Describe the Data Source and Structure

    Specify the file type, field structure, and known irregularities. For example:

    The input is a comma-separated text file with a header row. The email column is named “Contact Email.” Other fields include a record ID and department. Some email values are missing, and others contain leading or trailing whitespace. Preserve the record ID so that results can be traced back to the source data.

    This helps the generated program identify the correct field and avoid basic errors, such as guessing the wrong column name or treating the header as a data row.

    If files come from different sources, also specify delimiters, character encoding, and the policy for missing fields. Records that cannot be parsed should be reported rather than silently skipped.

    Rules: Replace Vague Terms with Explicit Decisions

    Terms such as “clean,” “correct,” and “duplicate” need concrete definitions.

    For example, the rules might state:

    • Treat missing values and whitespace-only values as missing.
    • Remove leading and trailing whitespace without changing internal characters.
    • Exclude clearly malformed addresses using explicitly defined format rules.
    • Normalize the case of the domain portion.
    • Retain the first occurrence of a duplicate in the original row order.
    • Do not automatically correct suspected spelling mistakes.

    Case handling in the local part of an email address requires particular care. Technically, the local part may be case-sensitive, so lowercasing the entire address is not a universally correct rule. If the business requires case-insensitive deduplication across the entire address, document that as an explicit business convention and preserve the original value.

    Outputs: Make the Results Explainable

    At least three deliverables are recommended.

    The first is a set of retained records for subsequent business use.

    The second is a set of excluded records containing the original row number, original field value, and exclusion reason for review.

    The third is a statistical summary showing the total number of input records, missing values, formatting errors, duplicates, and retained records.

    This is more reliable than producing only a “clean file.” If a result is questioned, the workflow can explain why a particular record was removed rather than requiring someone to reconstruct what the program did.

    Constraints: Define What the Tool Must Not Do

    Constraints might include:

    Do not overwrite the source file. Do not send data to external services. Do not access directories unrelated to the task. Do not automatically install unknown dependencies. If a required field is missing or the file cannot be read, stop execution and explain the reason.

    These are not merely supplementary instructions. They define the boundaries of execution. When personal contact information is involved, minimizing data exposure should be the default.

    Acceptance Criteria: Define “Done” Before Generating Code

    Acceptance should mean more than “the program completed successfully.” Criteria should include:

    • Output files can be read successfully.
    • Required fields are preserved.
    • Every input record has an explicit classification.
    • Duplicate handling follows the agreed policy.
    • The source file remains unchanged.
    • Repeated runs with the same input and rules produce consistent results.

    Defining these criteria before code generation makes subsequent revisions evidence-based rather than subjective.

    4. Email Validation Has Three Distinct Levels

    A common mistake in email cleaning is to treat “passes the format check” as equivalent to “is a usable mailbox.” These are different claims, involving at least three levels of validation.

    Level 1: Format Checks

    Format checks identify strings that clearly violate the selected rules—for example, addresses missing a required separator, containing disallowed whitespace, or having an obviously incomplete structure.

    They are suitable for offline batch processing, but they only establish compliance with the chosen rules. An overly simple rule may accept malformed values, while an overly strict one may reject legitimate but uncommon address formats.

    In this context, “valid email” therefore means an address that passes the current cleaning rules, not an address proven valid in every sense.

    Level 2: Domain Checks

    Domain checks can help determine whether a domain has relevant mail configuration. They require network access and may be affected by temporary failures or query limits.

    Even when mail configuration exists, it does not prove that a particular mailbox exists. Domain checks should therefore be a separate step, with the check time and status recorded, rather than a replacement for format validation.

    Level 3: Confirmation of Email Reception

    Confirming whether an address can receive email generally requires an appropriate, compliant confirmation process. Servers may reject probes, become temporarily unavailable, or use catch-all behavior, all of which can make automated conclusions unreliable.

    For ordinary spreadsheet cleanup, offline format validation and deduplication are usually sufficient as a first step. If the business requires further confirmation, design a separate process that respects applicable privacy and communications requirements.

    5. Validate a Small Sample Before Processing the Full Dataset

    Running the entire dataset immediately may appear faster, but any error in the rules will also be amplified across the data.

    A safer approach is to prepare a small test dataset covering normal and boundary cases:

    Test case Expected behavior
    Normally formatted email address Retain
    Address with leading or trailing spaces Trim whitespace, then evaluate
    Missing or whitespace-only value Classify as missing
    Address missing a required separator Classify as a format error
    Identical duplicate addresses Retain one according to the agreed policy
    Addresses differing only in domain case Apply the domain normalization rule
    Address containing unexpected internal spaces Flag as malformed; do not repair automatically
    Missing email column Stop and report a structural error

    Use fictional data for these tests to avoid exposing real contact information.

    Validation should go beyond checking whether the program throws an error. Compare each actual result with its expected result. When a discrepancy appears, identify the specific unmet rule. For example:

    The sixth record should be treated as a duplicate of the second, but both were retained. Check whether domain normalization happens before deduplication, and add a test for this case.

    This is more useful than “the result is wrong; rewrite it,” because it provides concrete evidence for the correction.

    6. Use an Explicit Processing Order to Reconcile Counts

    An auditable data-cleaning workflow can follow this illustrative logic:

    1. Read the input file and check required fields
    2. For each record:
    3. Preserve the original row number and original email value
    4. If the email is missing:
    5. Classify as "missing"
    6. Continue to the next record
    7. Remove leading and trailing whitespace
    8. If the email does not meet the agreed format rules:
    9. Classify as "format error"
    10. Continue to the next record
    11. Generate a deduplication key according to the agreed rules
    12. If the key has already been seen:
    13. Classify as "duplicate"
    14. Continue to the next record
    15. Save the deduplication key
    16. Classify as "retained"
    17. Output retained records, excluded records, and a statistical summary

    The important point is not a particular programming syntax, but the classification order. Each record receives exactly one final classification, allowing the following reconciliation:

    Input records = Missing records + Format-error records + Duplicate records + Retained records

    This relationship holds only when the categories are mutually exclusive and cover every input record. If there are unparseable rows or processing failures, those must also be included in the accounting. They must not disappear silently.

    Processing order also affects the outcome. For example, a record that contains surrounding whitespace and duplicates an existing address should undergo the permitted normalization before duplicate detection. Document this order explicitly rather than leaving it to an incidental implementation choice.

    7. Measure Efficiency Across the Entire Workflow

    Automating repetitive tasks with scripts can substantially reduce manual, row-by-row work. However, program execution time is not the same as total task time.

    The complete workflow also includes:

    • Clarifying business rules.
    • Preparing inputs and the runtime environment.
    • Reviewing the generated implementation.
    • Designing and running tests.
    • Handling exceptional records.
    • Reconciling outputs.
    • Saving the final deliverables.

    For a simple table containing a few thousand rows, computation may be quick. End-to-end completion time still depends on file quality, rule complexity, and validation requirements. It is not reasonable to promise that every cleaning task will finish within a fixed time or to derive a universal productivity multiplier from one example.

    The more durable benefit is turning repeated manual work into a reproducible process. Establishing the rules and validation mechanisms takes time initially, but the checked implementation can be reused when the next dataset with the same structure arrives.

    8. Enterprise Use Requires Additional Engineering Controls

    A personal, one-off task and an enterprise production task have different risk profiles. A script that processes a local copy can usually be rerun after an error. A script connected to a live business system may affect customer data, business processes, and compliance obligations.

    Before moving into an enterprise environment, several capabilities need to be added.

    Permission isolation comes first. The program should access only the data and directories needed for the task. Testing should avoid writing directly to production, and the program should not receive unrelated elevated privileges.

    Changes must be traceable. Record the requirements version, processing rules, implementation version, execution time, and output location. If results deviate from expectations, this information helps determine whether the cause was a change in the input, the rules, or the implementation.

    Failures need explicit handling and recovery. Corrupted files, changed fields, and insufficient resources should have defined responses. A partially failed batch must not leave behind an output that appears complete but is actually missing records.

    Human review remains important. Low-risk tasks with clear rules can support greater automation. High-risk tasks involving money, permissions, or changes to critical data should retain approval, backup, and rollback measures.

    Long-running workflows may also need logging, monitoring, alerts, and scheduled execution. Whether to use cloud resources should depend on data security, workload scale, and operational needs—not on a desire to automate by adding unnecessary system complexity.

    9. The Essential Skills Are Requirements Definition and Validation

    Natural language programming enables more business users to turn ideas into executable tools, but it does not remove the fundamentals of software engineering.

    For non-developers, the most useful starting skills are not extensive syntax knowledge. They are transferable abilities: identifying task boundaries, defining data rules, constructing test samples, interpreting error messages, and checking outputs.

    For developers, AI coding tools can handle parts of implementation, but architecture decisions, risk assessment, code review, and production quality still require professional expertise.

    The more accurate conclusion is not “technical understanding is no longer necessary,” but “users can start by solving a concrete problem and gradually learn the technical knowledge they need.”

    Whether the starting point is a single email spreadsheet or a broader business workflow, the reliable approach remains the same: define the problem clearly, validate the implementation, and deliver traceable results. Natural language lowers the barrier to expressing programming intent. Clear rules, sufficient testing, and explicit responsibility are what make automation dependable in practice.