Production automation needs testing. Interviewers notice when you mention tests.
Basic testing in Python:
def test_parse_log_line():
line = '2024-01-15 ERROR: Connection failed'
result = parse_log_line(line)
assert result['level'] == 'ERROR'
assert result['message'] == 'Connection failed'
What to test:
- Happy path (normal input)
- Edge cases (empty input, malformed data)
- Error conditions (file not found, API timeout)
Interview tip: Even if you don't write full tests during the interview, mention how you would test the code. "I'd add tests for empty files and malformed lines."