My basic question boils down to: when starting a fresh project, should I start by writing a functional test for a feature and then writing unit tests as I try to get the functional test to pass? Or should I start by thinking about a smaller component of that feature and then writing a unit test for that (and then later a functional test for the feature)?
For example, say I want the ability to Sign In to my web app. Do I first write a functional test laying out the steps that occur during the Sign In process (User is on Sign In page, User fills out required fields, User clicks Sign In button, etc.)? Or is it preferred to write unit tests for, say, the validation rules for the form fields first? I've been doing the former and now I'm questioning whether my workflow is flawed and whether there's some better approach I'm not seeing.
As an aside, I have a feeling this might get flagged for "calling for an opinion", but I've tried looking and asking around elsewhere and haven't been able to find a clear answer so far. Thanks in advance for any responses.