Yes it does teeter on a thin line, but your word "intent" is key here. What is their intention? An aggressive offensive play or to draw a foul because they know their decision to drive wasn't a good one and are trying to salvage something out of it.
From my view, attacking the basket isn't a bad thing. Defenders still have to do their job and if they block, reach, etc., it has to be called. However driving to the basket and "acting" as if you got fouled to convince the referee is a different thing all together. You even hear commentators mention when they feel a player sold the call when it doesn't look right to them.